【发布时间】:2020-02-18 12:22:26
【问题描述】:
我创建了一个应用程序来显示带有 flutter_inappwebview 插件的 html 文件,但出现以下错误:
pubspec.yaml
flutter_inappwebview: ^2.1.0
这是我的 main.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
Future main() async {
runApp(new MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
InAppWebViewController webView;
String url = "";
double progress = 0;
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
height: 200,
child: InAppWebView(
initialUrl: 'https://www.google.com',
),
);
}
}
当我运行代码时,应用程序不幸停止了。
这是模拟器中的错误。
这是 Android Studio 3.5.3 中的错误
有什么解决办法吗?
【问题讨论】:
-
它抛出的任何错误,如果你在这里发布错误日志会很好
-
我已经更新了错误图片,谢谢!
标签: flutter