pubdev地址:https://pub.dev/packages/flutter_inappwebview 官方文档:https://inappwebview.dev/docs/intro/ 参考资料:https://cloud.tencent.com/developer/news/667143
引入依赖
java
# webview加载
flutter_inappwebview: ^5.8.0
初始化
在main函数中初始化flutter_inappwebview
java
/// 主要界面
void main() {
//初始化flutter_inappwebview
WidgetsFlutterBinding.ensureInitialized();
runApp(MaterialApp(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepOrange),
useMaterial3: true,
),
home: MyApp()));
}