2019-12-09 23:29:52 +00:00
|
|
|
import 'dart:async';
|
2019-10-28 03:58:25 +00:00
|
|
|
|
2018-11-13 11:02:20 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2019-10-28 03:58:25 +00:00
|
|
|
|
2019-11-29 15:59:18 +00:00
|
|
|
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
2019-12-09 23:29:52 +00:00
|
|
|
import 'package:flutter_inappwebview_example/chrome_safari_browser_example.screen.dart';
|
|
|
|
import 'package:flutter_inappwebview_example/in_app_webiew_example.screen.dart';
|
|
|
|
import 'package:flutter_inappwebview_example/in_app_browser_example.screen.dart';
|
2019-10-28 03:58:25 +00:00
|
|
|
|
2019-03-12 01:14:30 +00:00
|
|
|
// InAppLocalhostServer localhostServer = new InAppLocalhostServer();
|
|
|
|
|
2018-11-13 11:02:20 +00:00
|
|
|
Future main() async {
|
2019-03-12 01:14:30 +00:00
|
|
|
// await localhostServer.start();
|
2018-11-13 11:02:20 +00:00
|
|
|
runApp(new MyApp());
|
|
|
|
}
|
|
|
|
|
2019-11-25 11:51:10 +00:00
|
|
|
Drawer myDrawer({@required BuildContext context}) {
|
|
|
|
return Drawer(
|
|
|
|
child: ListView(
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
children: <Widget>[
|
|
|
|
DrawerHeader(
|
|
|
|
child: Text('flutter_inappbrowser example'),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.blue,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ListTile(
|
|
|
|
title: Text('InAppBrowser'),
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pushReplacementNamed(context, '/InAppBrowser');
|
|
|
|
},
|
|
|
|
),
|
|
|
|
ListTile(
|
|
|
|
title: Text('ChromeSafariBrowser'),
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pushReplacementNamed(context, '/ChromeSafariBrowser');
|
|
|
|
},
|
|
|
|
),
|
|
|
|
ListTile(
|
|
|
|
title: Text('InAppWebView'),
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pushReplacementNamed(context, '/');
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-11-13 11:02:20 +00:00
|
|
|
class MyApp extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
_MyAppState createState() => new _MyAppState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _MyAppState extends State<MyApp> {
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp(
|
2019-11-28 01:32:03 +00:00
|
|
|
initialRoute: '/',
|
|
|
|
routes: {
|
|
|
|
'/': (context) => InAppWebViewExampleScreen(),
|
|
|
|
'/InAppBrowser': (context) => InAppBrowserExampleScreen(),
|
|
|
|
'/ChromeSafariBrowser': (context) => ChromeSafariBrowserExampleScreen(),
|
|
|
|
}
|
2018-11-13 11:02:20 +00:00
|
|
|
);
|
|
|
|
}
|
2019-11-28 01:32:03 +00:00
|
|
|
}
|