i have a simple code here that is just supposed to display a webpage using webview_flutter (https://pub.dev/packages/webview_flutter)
However, it automatically enables dark mode and displays dark version of the website. How can i prevent this?
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
MyAppState createState() => MyAppState();
}
class MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("Mobile App"),
backgroundColor: Colors.blueGrey,
),
body: WebView(
initialUrl: 'https://flutter.dev',
javascriptMode: JavascriptMode.unrestricted,
)),
debugShowCheckedModeBanner: false,
);
}
}