Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 颤振:关闭暗模式主题_Flutter - Fatal编程技术网

Flutter 颤振:关闭暗模式主题

Flutter 颤振:关闭暗模式主题,flutter,Flutter,当我在手机上激活黑暗模式的情况下测试我的应用程序时,cupertinoTabBar的变化会产生一个黑暗主题。我怎样才能防止这种情况?我只希望我的应用程序在灯光模式下设置主题。将ThemeMode.light设置为顶部应用程序组件(如MaterialApp)上的ThemeMode字段 比如说 MaterialApp( themeMode: ThemeMode.light, ) 此外,颤振有3种模态 //Use either the light or dark theme based on

当我在手机上激活黑暗模式的情况下测试我的应用程序时,cupertinoTabBar的变化会产生一个黑暗主题。我怎样才能防止这种情况?我只希望我的应用程序在灯光模式下设置主题。

ThemeMode.light
设置为顶部应用程序组件(如MaterialApp)上的
ThemeMode
字段

比如说

MaterialApp(
   themeMode: ThemeMode.light,
)
此外,颤振有3种模态

//Use either the light or dark theme based on what
//the user has selected in the system settings.
ThemeMode.system

// Always use the light mode regardless of system preference.
ThemeMode.light

//Always use the dark mode (if available) regardless of system preference.
ThemeMode.dark

将顶部应用程序组件(如MaterialApp)上的
emode.light
设置为
emode
字段

比如说

MaterialApp(
   themeMode: ThemeMode.light,
)
此外,颤振有3种模态

//Use either the light or dark theme based on what
//the user has selected in the system settings.
ThemeMode.system

// Always use the light mode regardless of system preference.
ThemeMode.light

//Always use the dark mode (if available) regardless of system preference.
ThemeMode.dark

这里还有一个很好的线索:

我很难改变顶栏的颜色。解决办法是增加

<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>

这将迫使您的状态栏变为黑色而不是白色。

这里还有一个很好的线索:

我很难改变顶栏的颜色。解决办法是增加

<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>

这将强制您的状态栏变为黑色而不是白色。

您可以共享您的应用程序主题代码吗?您是否尝试将材质应用程序主题设置为轻主题?像这样的
theme:ThemeData.light(),
你能分享你的应用程序主题代码吗?你试过把material应用程序主题设置为light吗?像这样
主题:ThemeData.light(),