|
|
@@ -1,4 +1,5 @@
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter/services.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
import '../resource/colors.gen.dart';
|
|
|
@@ -8,12 +9,26 @@ abstract class BasePage<T extends GetxController> extends GetView<T> {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- return Container(
|
|
|
- color: backgroundColor(),
|
|
|
- child: buildBody(context),
|
|
|
+ return AnnotatedRegion<SystemUiOverlayStyle>(
|
|
|
+ value: SystemUiOverlayStyle.light.copyWith(
|
|
|
+ statusBarColor: Colors.transparent, // 设置状态栏颜色为透明
|
|
|
+ statusBarIconBrightness: _getStatusBarDarkFont(),
|
|
|
+ ),
|
|
|
+ child: Container(
|
|
|
+ color: backgroundColor(),
|
|
|
+ child: buildBody(context),
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ Brightness _getStatusBarDarkFont() {
|
|
|
+ return statusBarDarkFont(true) ? Brightness.dark : Brightness.light;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool statusBarDarkFont(bool isDark) {
|
|
|
+ return isDark;
|
|
|
+ }
|
|
|
+
|
|
|
Widget? buildBody(BuildContext context);
|
|
|
|
|
|
Color backgroundColor() {
|