File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,9 @@ - (void)initWebview:(FlutterMethodCall*)call {
124124
125125 _enableZoom = [withZoom boolValue ];
126126
127- [self .viewController.view addSubview: self .webview];
127+ UIViewController* presentedViewController = self.viewController .presentedViewController ;
128+ UIViewController* currentViewController = presentedViewController != nil ? presentedViewController : self.viewController ;
129+ [currentViewController.view addSubview: self .webview];
128130
129131 [self navigate: call];
130132}
Original file line number Diff line number Diff line change @@ -95,8 +95,8 @@ class FlutterWebviewPlugin {
9595 /// - [scrollBar] : enable or disable scrollbar
9696 /// - [supportMultipleWindows] enable multiple windows support in Android
9797 /// - [invalidUrlRegex] is the regular expression of URLs that web view shouldn't load.
98- /// For example, when web view is redirected to a specific URL, you want to intercept
99- /// this process by stopping loading this URL and replacing web view by another screen.
98+ /// For example, when webview is redirected to a specific URL, you want to intercept
99+ /// this process by stopping loading this URL and replacing webview by another screen.
100100 Future <Null > launch (String url, {
101101 Map <String , String > headers,
102102 bool withJavascript,
You can’t perform that action at this time.
0 commit comments