Created
May 22, 2022 07:52
-
-
Save samuchakraborty/dad0ed3fcf737729b70a26cc8ed08312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; | |
class HomePage extends StatefulWidget { | |
//String useragent = | |
// "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36"; | |
@override | |
_HomePageState createState() => _HomePageState(); | |
} | |
class _HomePageState extends State<HomePage> { | |
String url; | |
@override | |
void initState() { | |
super.initState(); | |
url = "https://google.com"; | |
} | |
// String url; | |
String useragent = | |
"Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19"; | |
@override | |
Widget build(BuildContext context) { | |
return SafeArea( | |
child: WebviewScaffold( | |
userAgent: useragent, | |
// userAgent: "random", | |
// userAgent: "Chrome/81.0.0.0 Mobile", | |
url: url, | |
withZoom: true, | |
withLocalStorage: true, | |
geolocationEnabled: true, | |
withJavascript: true, | |
debuggingEnabled: true, | |
//userAgent: "Chrome/56.0.0 Mobile", | |
// supportMultipleWindows: true, | |
// hidden: false, | |
), | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment