From bca59d3e870d49e0d47ab9911756ea20545da060 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Wed, 20 Apr 2022 19:20:31 +0200 Subject: [PATCH] updated example --- .../chrome_safari_browser_example.screen.dart | 20 +++++++++---------- .../lib/in_app_browser_example.screen.dart | 2 +- example/lib/in_app_webiew_example.screen.dart | 4 ++-- example/lib/main.dart | 16 +++++++-------- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/example/lib/chrome_safari_browser_example.screen.dart b/example/lib/chrome_safari_browser_example.screen.dart index c2fb9a3c..f1ab1ea5 100755 --- a/example/lib/chrome_safari_browser_example.screen.dart +++ b/example/lib/chrome_safari_browser_example.screen.dart @@ -64,17 +64,15 @@ class _ChromeSafariBrowserExampleScreenState onPressed: () async { await widget.browser.open( url: Uri.parse("https://flutter.dev/"), - options: ChromeSafariBrowserClassOptions( - android: AndroidChromeCustomTabsOptions( - shareState: CustomTabsShareState.SHARE_STATE_OFF, - isSingleInstance: false, - isTrustedWebActivity: false, - keepAliveEnabled: true), - ios: IOSSafariOptions( - dismissButtonStyle: - IOSSafariDismissButtonStyle.CLOSE, - presentationStyle: - IOSUIModalPresentationStyle.OVER_FULL_SCREEN))); + settings: ChromeSafariBrowserSettings( + shareState: CustomTabsShareState.SHARE_STATE_OFF, + isSingleInstance: false, + isTrustedWebActivity: false, + keepAliveEnabled: true, + dismissButtonStyle: DismissButtonStyle.CLOSE, + presentationStyle: + ModalPresentationStyle.OVER_FULL_SCREEN + )); }, child: Text("Open Chrome Safari Browser")), )); diff --git a/example/lib/in_app_browser_example.screen.dart b/example/lib/in_app_browser_example.screen.dart index 2b9cdf3e..97a15e1d 100755 --- a/example/lib/in_app_browser_example.screen.dart +++ b/example/lib/in_app_browser_example.screen.dart @@ -91,7 +91,7 @@ class _InAppBrowserExampleScreenState extends State { super.initState(); pullToRefreshController = PullToRefreshController( - options: PullToRefreshOptions( + settings: PullToRefreshSettings( color: Colors.black, ), onRefresh: () async { diff --git a/example/lib/in_app_webiew_example.screen.dart b/example/lib/in_app_webiew_example.screen.dart index bb384a8b..4e0ca0ce 100755 --- a/example/lib/in_app_webiew_example.screen.dart +++ b/example/lib/in_app_webiew_example.screen.dart @@ -70,7 +70,7 @@ class _InAppWebViewExampleScreenState extends State { }); pullToRefreshController = PullToRefreshController( - options: PullToRefreshOptions( + settings: PullToRefreshSettings( color: Colors.blue, ), onRefresh: () async { @@ -132,7 +132,7 @@ class _InAppWebViewExampleScreenState extends State { urlController.text = this.url; }); }, - androidOnPermissionRequest: (controller, origin, resources) async { + onPermissionRequest: (controller, origin, resources) async { return PermissionRequestResponse( resources: resources, action: PermissionRequestResponseAction.GRANT); diff --git a/example/lib/main.dart b/example/lib/main.dart index 895042e5..7a7654a0 100755 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -20,18 +20,18 @@ Future main() async { // await Permission.storage.request(); if (Platform.isAndroid) { - await AndroidInAppWebViewController.setWebContentsDebuggingEnabled(true); + await InAppWebViewController.setWebContentsDebuggingEnabled(true); - var swAvailable = await AndroidWebViewFeature.isFeatureSupported( - AndroidWebViewFeature.SERVICE_WORKER_BASIC_USAGE); - var swInterceptAvailable = await AndroidWebViewFeature.isFeatureSupported( - AndroidWebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST); + var swAvailable = await WebViewFeature.isFeatureSupported( + WebViewFeature.SERVICE_WORKER_BASIC_USAGE); + var swInterceptAvailable = await WebViewFeature.isFeatureSupported( + WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST); if (swAvailable && swInterceptAvailable) { - AndroidServiceWorkerController serviceWorkerController = - AndroidServiceWorkerController.instance(); + ServiceWorkerController serviceWorkerController = + ServiceWorkerController.instance(); - serviceWorkerController.serviceWorkerClient = AndroidServiceWorkerClient( + serviceWorkerController.serviceWorkerClient = ServiceWorkerClient( shouldInterceptRequest: (request) async { print(request); return null;