From fbfc5c7822cef95240124a5f16e78be8b517c727 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 25 Jul 2024 18:02:36 +0800 Subject: [PATCH] feat: update dependency (#42) --- lib/src/casdoor_flutter_sdk_mobile.dart | 41 ++++++++++--------------- pubspec.yaml | 4 +-- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/lib/src/casdoor_flutter_sdk_mobile.dart b/lib/src/casdoor_flutter_sdk_mobile.dart index 407ce58..b77fe07 100644 --- a/lib/src/casdoor_flutter_sdk_mobile.dart +++ b/lib/src/casdoor_flutter_sdk_mobile.dart @@ -76,15 +76,14 @@ class _FullScreenAuthPageState extends State { return Stack( children: [ InAppWebView( - initialUrlRequest: URLRequest(url: Uri.parse(widget.params.url)), - initialOptions: InAppWebViewGroupOptions( - crossPlatform: InAppWebViewOptions( - userAgent: - "Mozilla/5.0 (Android 14; Mobile; rv:123.0) Gecko/123.0 Firefox/123.0", - clearCache: widget.params.clearCache!, - useShouldOverrideUrlLoading: true, - useOnLoadResource: true, - ), + initialUrlRequest: + URLRequest(url: WebUri.uri(Uri.parse(widget.params.url))), + initialSettings: InAppWebViewSettings( + userAgent: + "Mozilla/5.0 (Android 14; Mobile; rv:123.0) Gecko/123.0 Firefox/123.0", + clearCache: widget.params.clearCache!, + useShouldOverrideUrlLoading: true, + useOnLoadResource: true, ), shouldOverrideUrlLoading: (controller, navigationAction) async { final uri = navigationAction.request.url!; @@ -207,25 +206,19 @@ class CasdoorFlutterSdkMobile extends CasdoorFlutterSdkPlatform { }); await browser.openUrlRequest( - urlRequest: URLRequest(url: Uri.parse(params.url)), - options: InAppBrowserClassOptions( - inAppWebViewGroupOptions: InAppWebViewGroupOptions( - crossPlatform: InAppWebViewOptions( - userAgent: - "Mozilla/5.0 (Android 14; Mobile; rv:123.0) Gecko/123.0 Firefox/123.0", - clearCache: params.clearCache!, - useOnLoadResource: true, - useShouldOverrideUrlLoading: true, - ), + urlRequest: URLRequest(url: WebUri.uri(Uri.parse(params.url))), + settings: InAppBrowserClassSettings( + webViewSettings: InAppWebViewSettings( + userAgent: + "Mozilla/5.0 (Android 14; Mobile; rv:123.0) Gecko/123.0 Firefox/123.0", + clearCache: params.clearCache!, + useOnLoadResource: true, + useShouldOverrideUrlLoading: true, ), - crossPlatform: InAppBrowserOptions( + browserSettings: InAppBrowserSettings( hideUrlBar: true, toolbarTopBackgroundColor: Colors.grey.shade300, - ), - android: AndroidInAppBrowserOptions( toolbarTopFixedTitle: 'Login', - ), - ios: IOSInAppBrowserOptions( hideToolbarBottom: true, ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 48c94ae..4793a12 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,8 +17,8 @@ dependencies: path: ^1.8.2 path_provider: ^2.1.1 desktop_webview_window: ^0.2.3 - flutter_inappwebview: ^5.8.0 - http: '>=0.13.4 <1.0.0' + flutter_inappwebview: ^6.0.0 + http: ^1.0.0 crypto: ^3.0.2 jwt_decoder: ^2.0.1