Repository: flutter
Issue: [webview_flutter] Detect if WebView is installed
Labels: c: new feature,platform-android,p: webview,package,c: proposal,P2,team-android,triaged-android

## Use case

Disable Android WebView:

* Open "Andois System WebView" from apps
* Click "Disabled"

After that, when using flutter_webview in app, WebView does not work, which is expected, but as a developer I have no idea that it does not work. Console is full of errors, similar to this, but none reach my Flutter code:

```
E/flutter (21958): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(AndroidRuntimeException, android.util.AndroidRuntimeException: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed, Cause: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed, Stacktrace: android.util.AndroidRuntimeException: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
E/flutter (21958): 	at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:363)
E/flutter (21958): 	at android.webkit.WebStorage.getInstance(WebStorage.java:194)
E/flutter (21958): 	at io.flutter.plugins.webviewflutter.WebStorageHostApiImpl$WebStorageCreator.createWebStorage(WebStorageHostApiImpl.java:27)
E/flutter (21958): 	at io.flutter.plugins.webviewflutter.WebStorageHostApiImpl.create(WebStorageHostApiImpl.java:45)
E/flutter (21958): 	at io.flutter.plugins.webviewflutter.GeneratedAndroidWebView$WebStorageHostApi$-CC.lambda$setup$0(GeneratedAndroidWebView.java:2408)
E/flutter (21958): 	at io.flutter.plugins.webviewflutter.GeneratedAndroidWebView$WebStorageHostApi$$ExternalSyntheticLambda0.onMessage(Unknown Source:2)
E/flutter (21958): 	at io.flutter.plugin.common.BasicMessageChannel$IncomingMessageHandler.onMessage(BasicMessageChannel.java:217)
E/flutter (21958): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (21958): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0(DartMessenger.java:319)
E/flutter (21958): 	at io.flutter.embedding.engine.dart.DartMessenger.$r8$lambda$TsixYUB5E6FpKhMtCSQVHKE89gQ(Unknown Source:0)
E/flutter (21958): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (21958): 	at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (21958): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (21958): 	at android.os.Looper.loopOnce(Looper.java:201)
E/flutter (21958): 	at android.os.Looper.loop(Looper.java:288)
E/flutter (21958): 	at android.app.ActivityThread.main(ActivityThread.java:7870)
E/flutter (21958): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter (21958): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/flutter (21958): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
E/flutter (21958): Caused by: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
E/flutter (21958): 	at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:532)
E/flutter (21958): 	at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:348)
E/flutter (21958): 	... 18 more
E/flutter (21958): Caused by: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
E/flutter (21958): 	at android.webkit.WebViewFactory.getWebViewContextAndSetProvider(WebViewFactory.java:428)
E/flutter (21958): 	at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:493)
E/flutter (21958): 	... 19 more
E/flutter (21958): , null)
E/flutter (21958): #0      WebStorageHostApi.create (package:webview_flutter_android/src/android_webview.pigeon.dart:1898:7)
E/flutter (21958): <asynchronous suspension>
E/flutter (21958): 
```

## Proposal

Add a way to check if WebView is installed and/or initialised correctly. Could be separated method to call before using WebView widget or some kind of `onError` callback on WebView widget. Aim is to show error message to user that there is a problem with WebView.