From 26f0235c9807a8be906c13e2b0284612e6ade6d4 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Mon, 27 Nov 2023 18:41:59 +0100 Subject: [PATCH] updated analysis options --- analysis_options.yaml | 2 + example/analysis_options.yaml | 12 +- .../analysis_options.yaml | 2 + .../analysis_options.yaml | 2 + .../src/in_app_webview/in_app_webview.dart | 1 - .../src/print_job/print_job_controller.dart | 2 +- .../analysis_options.yaml | 2 + .../src/in_app_webview/in_app_webview.dart | 1 - .../analysis_options.yaml | 2 + ..._inappwebview_platform_interface_test.dart | 7 - .../analysis_options.yaml | 2 + lib/src/in_app_browser/in_app_browser.dart | 140 +++++++++++++----- .../pull_to_refresh_controller.dart | 1 - 13 files changed, 129 insertions(+), 47 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index c98f8e5d..84964c30 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -11,3 +11,5 @@ analyzer: errors: deprecated_member_use: ignore deprecated_member_use_from_same_package: ignore + unnecessary_cast: ignore + unnecessary_import: ignore diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index 61b84110..b3cbd634 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -11,4 +11,14 @@ include: package:flutter_lints/flutter.yaml linter: rules: - constant_identifier_names: ignore \ No newline at end of file + constant_identifier_names: ignore + deprecated_member_use_from_same_package: ignore + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options +analyzer: + errors: + deprecated_member_use: ignore + deprecated_member_use_from_same_package: ignore + unnecessary_cast: ignore + unnecessary_import: ignore diff --git a/flutter_inappwebview_android/analysis_options.yaml b/flutter_inappwebview_android/analysis_options.yaml index c98f8e5d..84964c30 100644 --- a/flutter_inappwebview_android/analysis_options.yaml +++ b/flutter_inappwebview_android/analysis_options.yaml @@ -11,3 +11,5 @@ analyzer: errors: deprecated_member_use: ignore deprecated_member_use_from_same_package: ignore + unnecessary_cast: ignore + unnecessary_import: ignore diff --git a/flutter_inappwebview_ios/analysis_options.yaml b/flutter_inappwebview_ios/analysis_options.yaml index c98f8e5d..84964c30 100644 --- a/flutter_inappwebview_ios/analysis_options.yaml +++ b/flutter_inappwebview_ios/analysis_options.yaml @@ -11,3 +11,5 @@ analyzer: errors: deprecated_member_use: ignore deprecated_member_use_from_same_package: ignore + unnecessary_cast: ignore + unnecessary_import: ignore diff --git a/flutter_inappwebview_ios/lib/src/in_app_webview/in_app_webview.dart b/flutter_inappwebview_ios/lib/src/in_app_webview/in_app_webview.dart index 3fbcc29b..a9bcdd82 100755 --- a/flutter_inappwebview_ios/lib/src/in_app_webview/in_app_webview.dart +++ b/flutter_inappwebview_ios/lib/src/in_app_webview/in_app_webview.dart @@ -1,4 +1,3 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; diff --git a/flutter_inappwebview_ios/lib/src/print_job/print_job_controller.dart b/flutter_inappwebview_ios/lib/src/print_job/print_job_controller.dart index 27eac98f..f56b826d 100644 --- a/flutter_inappwebview_ios/lib/src/print_job/print_job_controller.dart +++ b/flutter_inappwebview_ios/lib/src/print_job/print_job_controller.dart @@ -56,7 +56,7 @@ class IOSPrintJobController extends PlatformPrintJobController } @override - Future dismiss({bool animated: true}) async { + Future dismiss({bool animated = true}) async { Map args = {}; args.putIfAbsent("animated", () => animated); await channel?.invokeMethod('dismiss', args); diff --git a/flutter_inappwebview_macos/analysis_options.yaml b/flutter_inappwebview_macos/analysis_options.yaml index c98f8e5d..84964c30 100644 --- a/flutter_inappwebview_macos/analysis_options.yaml +++ b/flutter_inappwebview_macos/analysis_options.yaml @@ -11,3 +11,5 @@ analyzer: errors: deprecated_member_use: ignore deprecated_member_use_from_same_package: ignore + unnecessary_cast: ignore + unnecessary_import: ignore diff --git a/flutter_inappwebview_macos/lib/src/in_app_webview/in_app_webview.dart b/flutter_inappwebview_macos/lib/src/in_app_webview/in_app_webview.dart index 10a50cad..76627d16 100755 --- a/flutter_inappwebview_macos/lib/src/in_app_webview/in_app_webview.dart +++ b/flutter_inappwebview_macos/lib/src/in_app_webview/in_app_webview.dart @@ -1,4 +1,3 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; diff --git a/flutter_inappwebview_platform_interface/analysis_options.yaml b/flutter_inappwebview_platform_interface/analysis_options.yaml index c98f8e5d..84964c30 100644 --- a/flutter_inappwebview_platform_interface/analysis_options.yaml +++ b/flutter_inappwebview_platform_interface/analysis_options.yaml @@ -11,3 +11,5 @@ analyzer: errors: deprecated_member_use: ignore deprecated_member_use_from_same_package: ignore + unnecessary_cast: ignore + unnecessary_import: ignore diff --git a/flutter_inappwebview_platform_interface/test/flutter_inappwebview_platform_interface_test.dart b/flutter_inappwebview_platform_interface/test/flutter_inappwebview_platform_interface_test.dart index 8bd80fe6..e69de29b 100644 --- a/flutter_inappwebview_platform_interface/test/flutter_inappwebview_platform_interface_test.dart +++ b/flutter_inappwebview_platform_interface/test/flutter_inappwebview_platform_interface_test.dart @@ -1,7 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; - -import 'package:flutter_inappwebview_platform_interface/flutter_inappwebview_platform_interface.dart'; - -void main() { - -} diff --git a/flutter_inappwebview_web/analysis_options.yaml b/flutter_inappwebview_web/analysis_options.yaml index c98f8e5d..84964c30 100644 --- a/flutter_inappwebview_web/analysis_options.yaml +++ b/flutter_inappwebview_web/analysis_options.yaml @@ -11,3 +11,5 @@ analyzer: errors: deprecated_member_use: ignore deprecated_member_use_from_same_package: ignore + unnecessary_cast: ignore + unnecessary_import: ignore diff --git a/lib/src/in_app_browser/in_app_browser.dart b/lib/src/in_app_browser/in_app_browser.dart index 93acc9c5..f8bd6ef1 100755 --- a/lib/src/in_app_browser/in_app_browser.dart +++ b/lib/src/in_app_browser/in_app_browser.dart @@ -190,22 +190,30 @@ class InAppBrowser implements PlatformInAppBrowserEvents { void dispose() => platform.dispose(); @override - Future? androidOnFormResubmission(Uri? url) {} + Future? androidOnFormResubmission(Uri? url) { + return null; + } @override void androidOnGeolocationPermissionsHidePrompt() {} @override Future? - androidOnGeolocationPermissionsShowPrompt(String origin) {} + androidOnGeolocationPermissionsShowPrompt(String origin) { + return null; + } @override Future? androidOnJsBeforeUnload( - JsBeforeUnloadRequest jsBeforeUnloadRequest) {} + JsBeforeUnloadRequest jsBeforeUnloadRequest) { + return null; + } @override Future? androidOnPermissionRequest( - String origin, List resources) {} + String origin, List resources) { + return null; + } @override void androidOnReceivedIcon(Uint8List icon) {} @@ -221,42 +229,58 @@ class InAppBrowser implements PlatformInAppBrowserEvents { @override Future? androidOnRenderProcessResponsive( - Uri? url) {} + Uri? url) { + return null; + } @override Future? androidOnRenderProcessUnresponsive( - Uri? url) {} + Uri? url) { + return null; + } @override Future? androidOnSafeBrowsingHit( - Uri url, SafeBrowsingThreat? threatType) {} + Uri url, SafeBrowsingThreat? threatType) { + return null; + } @override void androidOnScaleChanged(double oldScale, double newScale) {} @override Future? androidShouldInterceptRequest( - WebResourceRequest request) {} + WebResourceRequest request) { + return null; + } @override void iosOnDidReceiveServerRedirectForProvisionalNavigation() {} @override Future? iosOnNavigationResponse( - IOSWKNavigationResponse navigationResponse) {} + IOSWKNavigationResponse navigationResponse) { + return null; + } @override void iosOnWebContentProcessDidTerminate() {} @override Future? iosShouldAllowDeprecatedTLS( - URLAuthenticationChallenge challenge) {} + URLAuthenticationChallenge challenge) { + return null; + } @override - Future? onAjaxProgress(AjaxRequest ajaxRequest) {} + Future? onAjaxProgress(AjaxRequest ajaxRequest) { + return null; + } @override - Future? onAjaxReadyStateChange(AjaxRequest ajaxRequest) {} + Future? onAjaxReadyStateChange(AjaxRequest ajaxRequest) { + return null; + } @override void onBrowserCreated() {} @@ -275,7 +299,9 @@ class InAppBrowser implements PlatformInAppBrowserEvents { void onContentSizeChanged(Size oldContentSize, Size newContentSize) {} @override - Future? onCreateWindow(CreateWindowAction createWindowAction) {} + Future? onCreateWindow(CreateWindowAction createWindowAction) { + return null; + } @override void onDidReceiveServerRedirectForProvisionalNavigation() {} @@ -300,27 +326,39 @@ class InAppBrowser implements PlatformInAppBrowserEvents { int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting) {} @override - Future? onFormResubmission(WebUri? url) {} + Future? onFormResubmission(WebUri? url) { + return null; + } @override void onGeolocationPermissionsHidePrompt() {} @override Future? - onGeolocationPermissionsShowPrompt(String origin) {} + onGeolocationPermissionsShowPrompt(String origin) { + return null; + } @override - Future? onJsAlert(JsAlertRequest jsAlertRequest) {} + Future? onJsAlert(JsAlertRequest jsAlertRequest) { + return null; + } @override Future? onJsBeforeUnload( - JsBeforeUnloadRequest jsBeforeUnloadRequest) {} + JsBeforeUnloadRequest jsBeforeUnloadRequest) { + return null; + } @override - Future? onJsConfirm(JsConfirmRequest jsConfirmRequest) {} + Future? onJsConfirm(JsConfirmRequest jsConfirmRequest) { + return null; + } @override - Future? onJsPrompt(JsPromptRequest jsPromptRequest) {} + Future? onJsPrompt(JsPromptRequest jsPromptRequest) { + return null; + } @override void onLoadError(Uri? url, int code, String message) {} @@ -332,11 +370,15 @@ class InAppBrowser implements PlatformInAppBrowserEvents { void onLoadResource(LoadedResource resource) {} @override - Future? onLoadResourceCustomScheme(Uri url) {} + Future? onLoadResourceCustomScheme(Uri url) { + return null; + } @override Future? onLoadResourceWithCustomScheme( - WebResourceRequest request) {} + WebResourceRequest request) { + return null; + } @override void onLoadStart(WebUri? url) {} @@ -353,7 +395,9 @@ class InAppBrowser implements PlatformInAppBrowserEvents { @override Future? onNavigationResponse( - NavigationResponse navigationResponse) {} + NavigationResponse navigationResponse) { + return null; + } @override void onOverScrolled(int x, int y, bool clampedX, bool clampedY) {} @@ -363,7 +407,9 @@ class InAppBrowser implements PlatformInAppBrowserEvents { @override Future? onPermissionRequest( - PermissionRequest permissionRequest) {} + PermissionRequest permissionRequest) { + return null; + } @override void onPermissionRequestCanceled(PermissionRequest permissionRequest) {} @@ -373,21 +419,27 @@ class InAppBrowser implements PlatformInAppBrowserEvents { @override Future? onPrintRequest( - WebUri? url, PlatformPrintJobController? printJobController) {} + WebUri? url, PlatformPrintJobController? printJobController) { + return null; + } @override void onProgressChanged(int progress) {} @override Future? onReceivedClientCertRequest( - URLAuthenticationChallenge challenge) {} + URLAuthenticationChallenge challenge) { + return null; + } @override void onReceivedError(WebResourceRequest request, WebResourceError error) {} @override Future? onReceivedHttpAuthRequest( - URLAuthenticationChallenge challenge) {} + URLAuthenticationChallenge challenge) { + return null; + } @override void onReceivedHttpError( @@ -401,7 +453,9 @@ class InAppBrowser implements PlatformInAppBrowserEvents { @override Future? onReceivedServerTrustAuthRequest( - URLAuthenticationChallenge challenge) {} + URLAuthenticationChallenge challenge) { + return null; + } @override void onReceivedTouchIconUrl(WebUri url, bool precomposed) {} @@ -410,18 +464,24 @@ class InAppBrowser implements PlatformInAppBrowserEvents { void onRenderProcessGone(RenderProcessGoneDetail detail) {} @override - Future? onRenderProcessResponsive(WebUri? url) {} + Future? onRenderProcessResponsive(WebUri? url) { + return null; + } @override Future? onRenderProcessUnresponsive( - WebUri? url) {} + WebUri? url) { + return null; + } @override void onRequestFocus() {} @override Future? onSafeBrowsingHit( - WebUri url, SafeBrowsingThreat? threatType) {} + WebUri url, SafeBrowsingThreat? threatType) { + return null; + } @override void onScrollChanged(int x, int y) {} @@ -446,20 +506,30 @@ class InAppBrowser implements PlatformInAppBrowserEvents { @override Future? shouldAllowDeprecatedTLS( - URLAuthenticationChallenge challenge) {} + URLAuthenticationChallenge challenge) { + return null; + } @override - Future? shouldInterceptAjaxRequest(AjaxRequest ajaxRequest) {} + Future? shouldInterceptAjaxRequest(AjaxRequest ajaxRequest) { + return null; + } @override Future? shouldInterceptFetchRequest( - FetchRequest fetchRequest) {} + FetchRequest fetchRequest) { + return null; + } @override Future? shouldInterceptRequest( - WebResourceRequest request) {} + WebResourceRequest request) { + return null; + } @override Future? shouldOverrideUrlLoading( - NavigationAction navigationAction) {} + NavigationAction navigationAction) { + return null; + } } diff --git a/lib/src/pull_to_refresh/pull_to_refresh_controller.dart b/lib/src/pull_to_refresh/pull_to_refresh_controller.dart index 97f44fc2..fbe5a5cb 100644 --- a/lib/src/pull_to_refresh/pull_to_refresh_controller.dart +++ b/lib/src/pull_to_refresh/pull_to_refresh_controller.dart @@ -2,7 +2,6 @@ import 'dart:ui'; import 'package:flutter/services.dart'; import 'package:flutter_inappwebview_platform_interface/flutter_inappwebview_platform_interface.dart'; -import '../in_app_browser/in_app_browser.dart'; ///{@macro flutter_inappwebview_platform_interface.PlatformPullToRefreshController} class PullToRefreshController {