|
@@ -49,7 +49,8 @@ class MyHomePage extends StatefulWidget {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
|
- TextEditingController _ctrl = new TextEditingController(text: "https://flutter.io");
|
|
|
|
|
|
|
+ TextEditingController _ctrl =
|
|
|
|
|
+ new TextEditingController(text: "https://flutter.io");
|
|
|
StreamSubscription _onDestroy;
|
|
StreamSubscription _onDestroy;
|
|
|
GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey();
|
|
GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey();
|
|
|
|
|
|
|
@@ -59,12 +60,12 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
|
FlutterWebviewPlugin.init();
|
|
FlutterWebviewPlugin.init();
|
|
|
_onDestroy = FlutterWebviewPlugin.onDestroy.listen((_) {
|
|
_onDestroy = FlutterWebviewPlugin.onDestroy.listen((_) {
|
|
|
if (mounted) {
|
|
if (mounted) {
|
|
|
- _scaffoldKey.currentState.showSnackBar(new SnackBar(content: new Text("Webview Destroyed")));
|
|
|
|
|
|
|
+ _scaffoldKey.currentState
|
|
|
|
|
+ .showSnackBar(new SnackBar(content: new Text("Webview Destroyed")));
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@override
|
|
@override
|
|
|
void dispose() {
|
|
void dispose() {
|
|
|
super.dispose();
|
|
super.dispose();
|
|
@@ -79,7 +80,9 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
|
title: new Text('Plugin example app'),
|
|
title: new Text('Plugin example app'),
|
|
|
),
|
|
),
|
|
|
body: new Column(children: [
|
|
body: new Column(children: [
|
|
|
- new Container(padding: const EdgeInsets.all(24.0), child: new TextField(controller: _ctrl)),
|
|
|
|
|
|
|
+ new Container(
|
|
|
|
|
+ padding: const EdgeInsets.all(24.0),
|
|
|
|
|
+ child: new TextField(controller: _ctrl)),
|
|
|
new RaisedButton(onPressed: _onPressed, child: new Text("Open Webview"))
|
|
new RaisedButton(onPressed: _onPressed, child: new Text("Open Webview"))
|
|
|
], mainAxisAlignment: MainAxisAlignment.center),
|
|
], mainAxisAlignment: MainAxisAlignment.center),
|
|
|
);
|
|
);
|