Browser constructor
const
Browser({
- Key? key,
- required String? initialUriString,
- BrowserController? controller,
- BrowserPolicy? policy,
- Widget? topBar = const AutoBrowserTopBar(),
- Widget contentBuilder(
- BuildContext context,
- BrowserController controller,
- Widget webView
- Widget? bottomBar = const AutoBrowserBottomBar(),
- Widget onError(
- BuildContext context,
- BrowserController controller,
- WebResourceError error
Constructs a browser widget.
Optional parameter policy specifies the allowed websites.
Optional parameter topBar is the bar above the web content. If null, no bar will be displayed.
If you want to replace some web pages with Flutter widgets, you can use contentBuilder.
Optional parameter bottomBar is the bar below the web content. If null, no bar will be displayed.
By default, a platform-specific URL sharing dialog is shown when the "share" button is pressed. You can override the behavior with onShare. If onShare is null, no "share" button will be displayed.
By default, the browser displays loading errors with its own widget. You can override the behavior with onError.
Implementation
const Browser({
Key? key,
required this.initialUriString,
this.controller,
this.policy,
this.topBar = const AutoBrowserTopBar(),
this.contentBuilder,
this.bottomBar = const AutoBrowserBottomBar(),
this.onShare = defaultOnShare,
this.onError = defaultOnError,
}) : super(key: key);