38 flutter_webview_plugin的使用
1.源代码
import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: WebviewScaffold(
url: "http://www.baidu.com",
appBar: new AppBar(
title: new Text("flutter_webview_plugin的使用"),
),
),
),
);
}
}
2.引用
flutter_webview_plugin: ^0.3.5
3.解释源代码
import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: WebviewScaffold(
//要打开的网址
url: "http://www.baidu.com",
appBar: new AppBar(
title: new Text("flutter_webview_plugin的使用"),
),
),
),
);
}
}