From be0fd7ab3eaa6e7676120a69c181cc9692abb7ed Mon Sep 17 00:00:00 2001 From: Michael Bui <25263378+MaikuB@users.noreply.github.com> Date: Fri, 4 Jun 2021 22:46:09 +1000 Subject: [PATCH] [flutter_appauth] Suppress android v1 embedding warnings (#212) * suppress warnings for using Android v1 embedding APIs * remove deprecated avoid_as linter rule * bump plugin version and update changelog --- flutter_appauth/CHANGELOG.md | 4 ++++ flutter_appauth/analysis_options.yaml | 1 - .../flutterappauth/FlutterAppauthPlugin.java | 10 +++------- flutter_appauth/example/analysis_options.yaml | 1 - flutter_appauth/pubspec.yaml | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/flutter_appauth/CHANGELOG.md b/flutter_appauth/CHANGELOG.md index f6046a1d..d9c6a641 100644 --- a/flutter_appauth/CHANGELOG.md +++ b/flutter_appauth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.0+1 + +* There are no functional changes in this release. The only changes done were to suppress warnings that were occurring as a result of making use of Android v1 embedding APIs for backwards compatibility + ## 1.0.0 * Migrated to null safety diff --git a/flutter_appauth/analysis_options.yaml b/flutter_appauth/analysis_options.yaml index a9b98f76..7e0257b1 100644 --- a/flutter_appauth/analysis_options.yaml +++ b/flutter_appauth/analysis_options.yaml @@ -51,7 +51,6 @@ linter: - always_specify_types - annotate_overrides # - avoid_annotating_with_dynamic # conflicts with always_specify_types - - avoid_as - avoid_bool_literals_in_conditional_expressions # - avoid_catches_without_on_clauses # we do this commonly # - avoid_catching_errors # we do this commonly diff --git a/flutter_appauth/android/src/main/java/io/crossingthestreams/flutterappauth/FlutterAppauthPlugin.java b/flutter_appauth/android/src/main/java/io/crossingthestreams/flutterappauth/FlutterAppauthPlugin.java index 774aaa24..029b7ab4 100644 --- a/flutter_appauth/android/src/main/java/io/crossingthestreams/flutterappauth/FlutterAppauthPlugin.java +++ b/flutter_appauth/android/src/main/java/io/crossingthestreams/flutterappauth/FlutterAppauthPlugin.java @@ -33,8 +33,6 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; import io.flutter.plugin.common.PluginRegistry; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import io.flutter.view.FlutterNativeView; /** * FlutterAppauthPlugin @@ -65,10 +63,8 @@ public class FlutterAppauthPlugin implements FlutterPlugin, MethodCallHandler, P private AuthorizationService defaultAuthorizationService; private AuthorizationService insecureAuthorizationService; - /** - * Plugin registration. - */ - public static void registerWith(Registrar registrar) { + @SuppressWarnings("deprecation") + public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registrar registrar) { final FlutterAppauthPlugin plugin = new FlutterAppauthPlugin(); plugin.setActivity(registrar.activity()); plugin.onAttachedToEngine(registrar.context(), registrar.messenger()); @@ -76,7 +72,7 @@ public static void registerWith(Registrar registrar) { registrar.addViewDestroyListener( new PluginRegistry.ViewDestroyListener() { @Override - public boolean onViewDestroy(FlutterNativeView view) { + public boolean onViewDestroy(io.flutter.view.FlutterNativeView view) { plugin.disposeAuthorizationServices(); return false; } diff --git a/flutter_appauth/example/analysis_options.yaml b/flutter_appauth/example/analysis_options.yaml index a9b98f76..7e0257b1 100644 --- a/flutter_appauth/example/analysis_options.yaml +++ b/flutter_appauth/example/analysis_options.yaml @@ -51,7 +51,6 @@ linter: - always_specify_types - annotate_overrides # - avoid_annotating_with_dynamic # conflicts with always_specify_types - - avoid_as - avoid_bool_literals_in_conditional_expressions # - avoid_catches_without_on_clauses # we do this commonly # - avoid_catching_errors # we do this commonly diff --git a/flutter_appauth/pubspec.yaml b/flutter_appauth/pubspec.yaml index d3892db0..528df384 100644 --- a/flutter_appauth/pubspec.yaml +++ b/flutter_appauth/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_appauth description: This plugin provides an abstraction around the Android and iOS AppAuth SDKs so it can be used to communicate with OAuth 2.0 and OpenID Connect providers -version: 1.0.0 +version: 1.0.0+1 homepage: https://github.com/MaikuB/flutter_appauth/tree/master/flutter_appauth environment: