Flutter: 沉浸式底栏的配置

在main函数加入:

import 'package:flutter/services.dart';

void main() {
  runApp(MyApp());

  // 沉浸式状态栏
  SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
  SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
    systemNavigationBarColor: Colors.transparent,
    systemNavigationBarIconBrightness: Brightness.dark,
  ));
}
暂无评论

发送评论 编辑评论


				
上一篇