2018-11-13 11:02:20 +00:00
|
|
|
import 'dart:async';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
|
2018-12-07 19:52:24 +00:00
|
|
|
import 'package:flutter_inappbrowser_example/chrome_safari_example.screen.dart';
|
|
|
|
import 'package:flutter_inappbrowser_example/inline_example.screen.dart';
|
|
|
|
import 'package:flutter_inappbrowser_example/webview_example.screen.dart';
|
2018-11-13 11:02:20 +00:00
|
|
|
|
|
|
|
Future main() async {
|
|
|
|
runApp(new MyApp());
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyApp extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
_MyAppState createState() => new _MyAppState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _MyAppState extends State<MyApp> {
|
|
|
|
InAppWebViewController webView;
|
|
|
|
String url = "";
|
|
|
|
double progress = 0;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp(
|
2018-12-07 19:52:24 +00:00
|
|
|
home: DefaultTabController(
|
2018-12-20 08:25:31 +00:00
|
|
|
length: 3,
|
|
|
|
child: Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text('Tabs Demo'),
|
|
|
|
),
|
|
|
|
body: TabBarView(
|
|
|
|
children: [
|
|
|
|
WebviewExampleScreen(),
|
|
|
|
ChromeSafariExampleScreen(),
|
|
|
|
InlineExampleScreen(),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
bottomNavigationBar: Container(
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
child: TabBar(
|
|
|
|
indicatorColor: Colors.white,
|
|
|
|
tabs: [
|
|
|
|
Tab(text: "Webview"),
|
|
|
|
Tab(text: "Chrome/Safari"),
|
|
|
|
Tab(
|
|
|
|
text: "Inline",
|
2018-12-07 19:52:24 +00:00
|
|
|
),
|
2018-12-20 08:25:31 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
))),
|
2018-11-13 11:02:20 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|