iosWebViewFix/example/lib/main.dart

76 lines
2.1 KiB
Dart
Raw Normal View History

import 'dart:async';
import 'dart:io';
2018-11-13 11:02:20 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
2019-03-12 01:14:30 +00:00
2018-11-13 11:02:20 +00:00
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
2020-05-23 17:33:54 +00:00
runApp(MyApp());
2018-11-13 11:02:20 +00:00
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
InAppWebViewController webView;
CookieManager _cookieManager = CookieManager.instance();
2018-11-13 11:02:20 +00:00
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('InAppWebView Example'),
),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: InAppWebView(
initialUrl: "https://github.com/",
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
debuggingEnabled: true
),
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {},
onLoadStop: (InAppWebViewController controller, String url) async {
},
)),
Expanded(
child: InAppWebView(
initialUrl: "https://github.com/",
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
debuggingEnabled: true
),
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {},
onLoadStop: (InAppWebViewController controller, String url) async {
},
))
])),
),
2018-11-13 11:02:20 +00:00
);
}
}