「Flutter/外部ライブラリ/webview flutter」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==インストール== pubspec.yaml <pre> dependencies: webview_flutter: ^1.0.7 </pre> ==公式== https://pub.dev/packages/webview_flutter ==サンプル起動== WebV...」) |
(相違点なし)
|
2020年12月1日 (火) 11:40時点における版
インストール
pubspec.yaml
dependencies: webview_flutter: ^1.0.7
公式
https://pub.dev/packages/webview_flutter
サンプル起動
WebView.platform = SurfaceAndroidWebView(); in initState().
サンプル
import 'dart:io';
import 'package:webview_flutter/webview_flutter.dart';
class WebViewExample extends StatefulWidget {
@override
WebViewExampleState createState() => WebViewExampleState();
}
class WebViewExampleState extends State<WebViewExample> {
@override
void initState() {
super.initState();
// Enable hybrid composition.
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
}
@override
Widget build(BuildContext context) {
return WebView(
initialUrl: 'https://flutter.dev',
);
}
}
