Reputation: 1819
I have created an app to display html file with flutter_inappwebview
plugin but i got errors as below:
pubspec.yaml
flutter_inappwebview: ^2.1.0
here is my 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',
),
);
}
}
when I run the code the app unfortunately stop.
This is an error in Emulator.
This is an error in Android Studio 3.5.3
Any solutions thanks?
Upvotes: 0
Views: 5391
Reputation: 846
After looking at issue in github issue link, here is the solution:
From
dependencies:
flutter_inappwebview: ^2.1.0+1
To
dependencies:
flutter_inappwebview:
git:
url: https://github.com/pichillilorenzo/flutter_inappwebview.git
Then run flutter clean
and then run the app. It should solve the problem.
Upvotes: 2