co_flutter_webview 0.0.13 copy "co_flutter_webview: ^0.0.13" to clipboard
co_flutter_webview: ^0.0.13 copied to clipboard

A Flutter plugin that you can easilly develop for co_flutter_webview.

example/lib/main.dart

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:co_flutter_webview/co_flutter_webview.dart';
import 'package:flutter_webview_example/webiew_example.screen.dart';

InAppLocalhostServer localhostServer =
    InAppLocalhostServer(documentRoot: 'assets');

Future main() async {
  WidgetsFlutterBinding.ensureInitialized();

  if (!kIsWeb && defaultTargetPlatform == TargetPlatform.android) {
    await InAppWebViewController.setWebContentsDebuggingEnabled(kDebugMode);
  }

  if (!kIsWeb) {
    await localhostServer.start();
  }

  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomeScreen(), // 新しいホーム画面を設定
    );
  }
}

class HomeScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('test'),
      ),
      body: Center(
        child: ElevatedButton(
          child: Text('Open WebView'),
          onPressed: () {
            Navigator.push(
              context,
              MaterialPageRoute(builder: (context) => WebViewExampleScreen()),
            );
          },
        ),
      ),
    );
  }
}
0
likes
150
points
53
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that you can easilly develop for co_flutter_webview.

Homepage

Topics

#html #webview #webview-flutter #inappwebview #browser

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

co_flutter_webview_android, co_flutter_webview_ios, co_flutter_webview_platform_interface, flutter

More

Packages that depend on co_flutter_webview

Packages that implement co_flutter_webview