当我在手机上激活深色模式的情况下测试我的应用程序时,cupertinoTabBar 的更改会变成深色主题。我怎样才能防止这种情况发生?我只希望我的应用程序以浅色模式为主题。
Ban*_*Nam 12
设置ThemeMode.light为themeMode顶级应用程序组件(例如 MaterialApp)上的字段。
例如。
MaterialApp(
themeMode: ThemeMode.light,
)
Run Code Online (Sandbox Code Playgroud)
另外,Flutter中还有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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8522 次 |
| 最近记录: |