chai_webview_plugin 0.0.3-dev02 chai_webview_plugin: ^0.0.3-dev02 copied to clipboard
flutter webview plugin
import 'package:chai_webview_plugin_example/webview_opener.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'ChaiWebviewPluginDemo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final urlInputController = TextEditingController();
@override
void initState() {
super.initState();
urlInputController.text = 'https://www7.lunapic.com/editor/?action=crop';
}
@override
void dispose() {
urlInputController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('ChaiWebview example app'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Center(
child: TextField(
controller: urlInputController,
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
openWebView(context, urlInputController.text);
},
tooltip: 'open test website',
child: Icon(Icons.add),
),
);
}
}