diff --git a/example/lib/headless_in_app_webview.screen.dart b/example/lib/headless_in_app_webview.screen.dart index 8cc3c185..6cd0d98f 100755 --- a/example/lib/headless_in_app_webview.screen.dart +++ b/example/lib/headless_in_app_webview.screen.dart @@ -42,7 +42,7 @@ class _HeadlessInAppWebViewExampleScreenState this.url = url.toString(); }); }, - onUpdateVisitedHistory: (controller, url, androidIsReload) { + onUpdateVisitedHistory: (controller, url, isReload) { setState(() { this.url = url.toString(); }); diff --git a/example/lib/in_app_browser_example.screen.dart b/example/lib/in_app_browser_example.screen.dart index 8a6583fc..37e87165 100755 --- a/example/lib/in_app_browser_example.screen.dart +++ b/example/lib/in_app_browser_example.screen.dart @@ -102,6 +102,10 @@ class _InAppBrowserExampleScreenState extends State { urlRequest: URLRequest(url: Uri.parse("https://flutter.dev")), settings: InAppBrowserClassSettings( + browserSettings: InAppBrowserSettings( + toolbarTopBackgroundColor: Colors.blue, + presentationStyle: ModalPresentationStyle.POPOVER + ), webViewSettings: InAppWebViewSettings( useShouldOverrideUrlLoading: true, useOnLoadResource: true, diff --git a/example/lib/in_app_webiew_example.screen.dart b/example/lib/in_app_webiew_example.screen.dart index 2d97b1e2..10586b29 100755 --- a/example/lib/in_app_webiew_example.screen.dart +++ b/example/lib/in_app_webiew_example.screen.dart @@ -19,7 +19,6 @@ class _InAppWebViewExampleScreenState extends State { InAppWebViewSettings settings = InAppWebViewSettings( useShouldOverrideUrlLoading: true, mediaPlaybackRequiresUserGesture: false, - isFindInteractionEnabled: false, allowsInlineMediaPlayback: true, iframeAllow: "camera; microphone", iframeAllowFullscreen: true @@ -116,7 +115,7 @@ class _InAppWebViewExampleScreenState extends State { InAppWebView( key: webViewKey, initialUrlRequest: - URLRequest(url: Uri.parse('https://github.com/flutter')), + URLRequest(url: Uri.parse('https://flutter.dev')), // initialUrlRequest: // URLRequest(url: Uri.parse(Uri.base.toString().replaceFirst("/#/", "/") + 'page.html')), // initialFile: "assets/index.html", @@ -182,7 +181,7 @@ class _InAppWebViewExampleScreenState extends State { urlController.text = this.url; }); }, - onUpdateVisitedHistory: (controller, url, androidIsReload) { + onUpdateVisitedHistory: (controller, url, isReload) { setState(() { this.url = url.toString(); urlController.text = this.url; diff --git a/example/lib/main.dart b/example/lib/main.dart index 9550c8f1..6d9e54e8 100755 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -9,6 +9,7 @@ import 'package:flutter_inappwebview_example/headless_in_app_webview.screen.dart import 'package:flutter_inappwebview_example/in_app_webiew_example.screen.dart'; import 'package:flutter_inappwebview_example/in_app_browser_example.screen.dart'; import 'package:flutter_inappwebview_example/web_authentication_session_example.screen.dart'; +import 'package:pointer_interceptor/pointer_interceptor.dart'; // import 'package:path_provider/path_provider.dart'; // import 'package:permission_handler/permission_handler.dart'; @@ -26,53 +27,55 @@ Future main() async { await InAppWebViewController.setWebContentsDebuggingEnabled(true); } - await localhostServer.start(); + // await localhostServer.start(); runApp(MyApp()); } -Drawer myDrawer({required BuildContext context}) { - return Drawer( - child: ListView( - padding: EdgeInsets.zero, - children: [ - DrawerHeader( - child: Text('flutter_inappbrowser example'), - decoration: BoxDecoration( - color: Colors.blue, +PointerInterceptor myDrawer({required BuildContext context}) { + return PointerInterceptor( + child: Drawer( + child: ListView( + padding: EdgeInsets.zero, + children: [ + DrawerHeader( + child: Text('flutter_inappwebview example'), + decoration: BoxDecoration( + color: Colors.blue, + ), ), - ), - ListTile( - title: Text('InAppBrowser'), - onTap: () { - Navigator.pushReplacementNamed(context, '/InAppBrowser'); - }, - ), - ListTile( - title: Text('ChromeSafariBrowser'), - onTap: () { - Navigator.pushReplacementNamed(context, '/ChromeSafariBrowser'); - }, - ), - ListTile( - title: Text('WebAuthenticationSession'), - onTap: () { - Navigator.pushReplacementNamed(context, '/WebAuthenticationSession'); - }, - ), - ListTile( - title: Text('InAppWebView'), - onTap: () { - Navigator.pushReplacementNamed(context, '/'); - }, - ), - ListTile( - title: Text('HeadlessInAppWebView'), - onTap: () { - Navigator.pushReplacementNamed(context, '/HeadlessInAppWebView'); - }, - ), - ], + ListTile( + title: Text('InAppBrowser'), + onTap: () { + Navigator.pushReplacementNamed(context, '/InAppBrowser'); + }, + ), + ListTile( + title: Text('ChromeSafariBrowser'), + onTap: () { + Navigator.pushReplacementNamed(context, '/ChromeSafariBrowser'); + }, + ), + ListTile( + title: Text('WebAuthenticationSession'), + onTap: () { + Navigator.pushReplacementNamed(context, '/WebAuthenticationSession'); + }, + ), + ListTile( + title: Text('InAppWebView'), + onTap: () { + Navigator.pushReplacementNamed(context, '/'); + }, + ), + ListTile( + title: Text('HeadlessInAppWebView'), + onTap: () { + Navigator.pushReplacementNamed(context, '/HeadlessInAppWebView'); + }, + ), + ], + ), ), ); } diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 55579f4b..ea4d2bac 100755 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -26,6 +26,7 @@ dependencies: path_provider: ^2.0.9 permission_handler: ^10.0.2 url_launcher: ^6.0.20 + pointer_interceptor: ^0.9.3+3 # connectivity: ^0.4.5+6 flutter_inappwebview: path: ../ diff --git a/pubspec.yaml b/pubspec.yaml index 0773155c..4c44afce 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - js: ^0.6.3 + js: ^0.6.4 flutter_inappwebview_internal_annotations: ^1.0.0 dev_dependencies: