Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ios/Classes/InAppWebView/FlutterWebViewFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Foundation

public class FlutterWebViewFactory: NSObject, FlutterPlatformViewFactory {
static let VIEW_TYPE_ID = "com.pichillilorenzo/flutter_inappwebview"
static let NON_BLOCKING_VIEW_TYPE_ID = "com.pichillilorenzo/flutter_inappwebview_nonblocking"
private var plugin: SwiftFlutterPlugin

init(plugin: SwiftFlutterPlugin) {
Expand Down
1 change: 1 addition & 0 deletions ios/Classes/SwiftFlutterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {

self.registrar = registrar
registrar.register(FlutterWebViewFactory(plugin: self) as FlutterPlatformViewFactory, withId: FlutterWebViewFactory.VIEW_TYPE_ID)
registrar.register(FlutterWebViewFactory(plugin: self) as FlutterPlatformViewFactory, withId: FlutterWebViewFactory.NON_BLOCKING_VIEW_TYPE_ID, gestureRecognizersBlockingPolicy:FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded)

platformUtil = PlatformUtil(plugin: self)
inAppBrowserManager = InAppBrowserManager(plugin: self)
Expand Down
8 changes: 7 additions & 1 deletion lib/src/in_app_webview/in_app_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class InAppWebView extends StatefulWidget implements WebView {
///- iOS
final InAppWebViewKeepAlive? keepAlive;

final bool? preventGestureDelay;

///{@macro flutter_inappwebview.InAppWebView}
const InAppWebView({
Key? key,
Expand Down Expand Up @@ -187,6 +189,7 @@ class InAppWebView extends StatefulWidget implements WebView {
this.onContentSizeChanged,
this.gestureRecognizers,
this.headlessWebView,
this.preventGestureDelay,
}) : super(key: key);

@override
Expand Down Expand Up @@ -799,8 +802,11 @@ class _InAppWebViewState extends State<InAppWebView> {
},
);
} else if (Util.isIOS /* || Util.isMacOS*/) {
final viewType = widget.preventGestureDelay == true
? 'com.pichillilorenzo/flutter_inappwebview_nonblocking'
: 'com.pichillilorenzo/flutter_inappwebview';
return UiKitView(
viewType: 'com.pichillilorenzo/flutter_inappwebview',
viewType: viewType,
onPlatformViewCreated: _onPlatformViewCreated,
gestureRecognizers: widget.gestureRecognizers,
creationParams: <String, dynamic>{
Expand Down