chai_webview_plugin 0.0.3-dev02 copy "chai_webview_plugin: ^0.0.3-dev02" to clipboard
chai_webview_plugin: ^0.0.3-dev02 copied to clipboard

outdated

flutter webview plugin

example/lib/main.dart

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),
      ),
    );
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

flutter webview plugin

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on chai_webview_plugin