I know its possible to add a WebView as a full page but couldn\'t find any sample code to do it. I assume you could use a PageView as it\'s base but not sure how to call the
In pubspec.yml file add dependency:
webview_flutter: ^0.1.1
For ioS App below keys paste in .plist file inside the ios project folder
io.flutter.embedded_views_preview yes
NSAppTransportSecurity
NSAllowsArbitraryLoads
NSAllowsArbitraryLoadsInWebContent
and this is class code:
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'dart:async';
class WebViewClass extends StatefulWidget {
@override
_WebViewClassState createState() => _WebViewClassState();
}
class _WebViewClassState extends State {
Completer _controller = Completer();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('WebView'),
),
body: WebView(
initialUrl: 'https://google.com',
onWebViewCreated: (WebViewController webViewController) {
_controller.complete(webViewController);
},
),
);
}
}