fluttercommunity / fluttercommunity/flutter_webview_plugin
This plugin isn't working in flutter web. After launching the webview the spinner keeps on spinning with no errors.
- Dominant language
- Java
- Stars
- 1.5k
- Forks
- 938
- PR merge metrics
- No merged PRs in 30d
Description
import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
String url = "https://google.com/";
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Webview Example',
theme: ThemeData.dark(),
routes: {
"/": (_) => Home(),
"/webview": (_) => WebviewScaffold(
url: url,
appBar: AppBar(
title: Text("WebView"),
),
withJavascript: true,
withLocalStorage: true,
withZoom: true,
)
},
);
}
}
class Home extends StatefulWidget {
@override
HomeState createState() => HomeState();
}
class HomeState extends State {
final webView = FlutterWebviewPlugin();
TextEditingController controller = TextEditingController(text: url);
@override
void initState() {
super.initState();
webView.close();
controller.addListener(() {
url = controller.text;
});
}
@override
void dispose() {
webView.dispose();
controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("WebView"),
),
body: Center(
child: Column(
children: [
Container(
padding: EdgeInsets.all(10.0),
child: TextField(
controller: controller,
),
),
RaisedButton(
child: Text("Open Webview"),
onPressed: () {
Navigator.of(context).pushNamed("/webview");
},
)
],
),
));
}
}
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.