Piseth Sok
Piseth Sok

Reputation: 1819

How to solve flutter inappwebview stopped working?

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.

enter image description here


This is an error in Android Studio 3.5.3

enter image description here

Any solutions thanks?

Upvotes: 0

Views: 5391

Answers (1)

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

Related Questions