-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[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
@@ -7,7 +7,7 @@ publish_to: none | |||
|
|||
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
PlatformWebViewWidget
to the v4 Android implementation.Part of issue flutter/flutter#94051
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style].///
).