-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[webview_flutter] Added Android implementation of PlatformWebViewWidget #6686
[webview_flutter] Added Android implementation of PlatformWebViewWidget #6686
Conversation
01c3845 to
fb9203b
Compare
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return AndroidView( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this still uses VirtualDisplay. This should use the TLHC implementation with PlatformViewLink and PlatformViewsService.initSurfaceAndroidView:
https://github.com/flutter/plugins/blob/main/packages/webview_flutter/webview_flutter_android/lib/webview_surface_android.dart#L47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a nit.
It looks like the analyze check is still failing for packages/webview_flutter/webview_flutter_android/lib/src/v4/src/android_webview_controller.dart. It took me a few tries to figure it out since you have to make it work with the current Flutter version and the 2 previous stable versions.
This combination might work:
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';And remove foundation and gestures.
packages/webview_flutter/webview_flutter_android/lib/src/v4/src/android_webview_controller.dart
Show resolved
Hide resolved
| environment: | ||
| sdk: ">=2.17.0 <3.0.0" | ||
| flutter: ">=3.0.0" | ||
| flutter: ">=3.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I debugged the error from the legacy analyze test and it looks like this is the culprit. Updating this version also requires you to update the minimum Flutter version of webview_flutter to 3.3.0.
Adds the Android implementation of the
PlatformWebViewWidgetto the v4 Android implementation.Part of issue flutter/flutter#94051
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.mdto add a description of the change, [following repository CHANGELOG style].///).