Closed tony123S closed 3 years ago
This is not related to the plugin, you can override the current theme by wrapping the desired widget in a Theme widget something similar to :
@override
Widget build(BuildContext context) {
return new Theme(
child: appBar,
data: new ThemeData.dark()
);
}
why is ThemeData.dark()?
You can use the themedata as you want,
ThemeData.light()
https://api.flutter.dev/flutter/material/ThemeData-class.html https://api.flutter.dev/flutter/material/Theme/Theme.html
the content color still change
I managed to fix it by adding this line in android/app/src/res/values/styles.xml
<item name="android:forceDarkAllowed">false</item>
Here my full code
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
</resources>
I am developing an application in Flutter (with a webview) and when dark mode is activated on the device, the webview changes the colors of the web (text and background) to make it dark, creating a horrible result.