@@ -22,15 +22,14 @@ class WebView extends StatefulWidget {
2222 /// The web view can be controlled using a `WebViewController` that is passed to the
2323 /// `onWebViewCreated` callback once the web view is created.
2424 ///
25- /// The `gestureRecognizers` and ` javaScriptMode` parameters must not be null.
25+ /// The `javaScriptMode` parameter must not be null.
2626 const WebView ({
2727 Key key,
2828 this .onWebViewCreated,
2929 this .initialUrl,
3030 this .javaScriptMode = JavaScriptMode .disabled,
31- this .gestureRecognizers = const < OneSequenceGestureRecognizer > [],
32- }) : assert (gestureRecognizers != null ),
33- assert (javaScriptMode != null ),
31+ this .gestureRecognizers,
32+ }) : assert (javaScriptMode != null ),
3433 super (key: key);
3534
3635 /// If not null invoked once the web view is created.
@@ -39,13 +38,13 @@ class WebView extends StatefulWidget {
3938 /// Which gestures should be consumed by the web view.
4039 ///
4140 /// It is possible for other gesture recognizers to be competing with the web view on pointer
42- /// events, e.g if the webview is inside a [ListView] the [ListView] will want to handle
41+ /// events, e.g if the web view is inside a [ListView] the [ListView] will want to handle
4342 /// vertical drags. The web view will claim gestures that are recognized by any of the
4443 /// recognizers on this list.
4544 ///
46- /// When this list is empty, the web view will only handle pointer events for gestures that
45+ /// When this set is empty or null , the web view will only handle pointer events for gestures that
4746 /// were not claimed by any other gesture recognizer.
48- final List < OneSequenceGestureRecognizer > gestureRecognizers;
47+ final Set < Factory < OneSequenceGestureRecognizer > > gestureRecognizers;
4948
5049 /// The initial URL to load.
5150 final String initialUrl;
@@ -85,6 +84,14 @@ class _WebViewState extends State<WebView> {
8584 creationParamsCodec: const StandardMessageCodec (),
8685 ),
8786 );
87+ } else if (defaultTargetPlatform == TargetPlatform .iOS) {
88+ return UiKitView (
89+ viewType: 'plugins.flutter.io/webview' ,
90+ onPlatformViewCreated: _onPlatformViewCreated,
91+ gestureRecognizers: widget.gestureRecognizers,
92+ creationParams: _CreationParams .fromWidget (widget).toMap (),
93+ creationParamsCodec: const StandardMessageCodec (),
94+ );
8895 }
8996 return Text (
9097 '$defaultTargetPlatform is not yet supported by the webview_flutter plugin' );
0 commit comments