Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Anirudhk07/163ec51bc45aac01d722a21adcf48f95 to your computer and use it in GitHub Desktop.
Save Anirudhk07/163ec51bc45aac01d722a21adcf48f95 to your computer and use it in GitHub Desktop.
WebViewContainer
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class WebViewContainer extends StatefulWidget {
final url;
WebViewContainer(this.url);
@override
createState() => _WebViewContainerState(this.url);
}
class _WebViewContainerState extends State<WebViewContainer> {
var _url;
final _key = UniqueKey();
_WebViewContainerState(this._url);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Column(
children: [
Expanded(
child: WebView(
key: _key,
javascriptMode: JavascriptMode.unrestricted,
initialUrl: _url))
],
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment