Ald*_*uan 2 flutter flutter-layout
当时我的状态栏是可见的,但是在我使用flutter_native_splash和flutter_launcher_icons包之后
它就消失了。
我已经尝试在构建方法中使用 SystemChrome 或运行方法不起作用
SystemChrome.setEnabledSystemUIOverlays(
SystemUiOverlay.values);
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Colors.transparent));
Run Code Online (Sandbox Code Playgroud)
有人知道会发生什么吗?
我的构建小部件
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays(
SystemUiOverlay.values);
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Colors.white));
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
return MultiProvider(
providers: [
ChangeNotifierProvider.value(
value: SeedProvider(),
),
ChangeNotifierProvider.value(
value: SurgeryProvider(),
),
ChangeNotifierProvider.value(
value: CookingProvider(),
),
ChangeNotifierProvider.value(
value: FishingProvider(),
),
ChangeNotifierProvider.value(
value: CombiningProvider(),
),
ChangeNotifierProvider.value(
value: CrystalsProvider(),
)
],
child: MaterialApp(
title: 'Grow Guides',
theme: ThemeData(
primaryColorBrightness: Brightness.light,
primarySwatch: Colors.teal,
appBarTheme: AppBarTheme(
textTheme: Theme.of(context)
.textTheme
.apply(bodyColor: Colors.white, displayColor: Colors.white),
iconTheme: IconThemeData(color: Colors.white)),
visualDensity: VisualDensity.adaptivePlatformDensity,
),
localizationsDelegates: [
AppLocale.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: [
const Locale('en'),
const Locale('id'),
],
onGenerateRoute: onGenerateRoute,
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(title: Text("Growtopia Guides")),
body: HomePage(),
)),
);
}
Run Code Online (Sandbox Code Playgroud)
我不确定确切的问题在哪里,请随时询问我的代码文件
我弄清楚会发生什么,我会将其发布在这里,以防有人遇到像我一样的问题。问题是在我使用我描述的那些包之后,它更改了 styles.xml,进行了android/app/src/main/res/values一些更改,例如:
<item name="android:windowFullscreen">true</item>
这使得我的应用程序变成全屏并且状态栏变得不可见,所以我将其更改为 false 并且工作得很好。这完全是我的错,没有检查软件包所做的更改:D
| 归档时间: |
|
| 查看次数: |
2054 次 |
| 最近记录: |