[local_auth] Change stopAuthentication to return false instead of throwing on iOS. (#5249)
diff --git a/packages/local_auth/local_auth_ios/CHANGELOG.md b/packages/local_auth/local_auth_ios/CHANGELOG.md
index 7f198f2..d826cc8 100644
--- a/packages/local_auth/local_auth_ios/CHANGELOG.md
+++ b/packages/local_auth/local_auth_ios/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.0.1
+
+* BREAKING CHANGE: Changes `stopAuthentication` to always return false instead of throwing an error.
+
## 1.0.0
* Initial release from migration to federated architecture.
diff --git a/packages/local_auth/local_auth_ios/lib/local_auth_ios.dart b/packages/local_auth/local_auth_ios/lib/local_auth_ios.dart
index 7d085cc..d92d076 100644
--- a/packages/local_auth/local_auth_ios/lib/local_auth_ios.dart
+++ b/packages/local_auth/local_auth_ios/lib/local_auth_ios.dart
@@ -81,8 +81,9 @@
Future<bool> isDeviceSupported() async =>
(await _channel.invokeMethod<bool>('isDeviceSupported')) ?? false;
+ /// Always returns false as this method is not supported on iOS.
@override
Future<bool> stopAuthentication() async {
- throw UnimplementedError('stopAuthentication() is not supported on iOS.');
+ return false;
}
}
diff --git a/packages/local_auth/local_auth_ios/pubspec.yaml b/packages/local_auth/local_auth_ios/pubspec.yaml
index a9126fd..537b1a6 100644
--- a/packages/local_auth/local_auth_ios/pubspec.yaml
+++ b/packages/local_auth/local_auth_ios/pubspec.yaml
@@ -2,7 +2,7 @@
description: iOS implementation of the local_auth plugin.
repository: https://github.com/flutter/plugins/tree/master/packages/local_auth/local_auth_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22
-version: 1.0.0
+version: 1.0.1
environment:
sdk: ">=2.14.0 <3.0.0"
diff --git a/packages/local_auth/local_auth_ios/test/local_auth_test.dart b/packages/local_auth/local_auth_ios/test/local_auth_test.dart
index b529764..180383b 100644
--- a/packages/local_auth/local_auth_ios/test/local_auth_test.dart
+++ b/packages/local_auth/local_auth_ios/test/local_auth_test.dart
@@ -75,9 +75,9 @@
);
});
- test('stopAuthentication throws UnimplementedError', () async {
- expect(() async => await localAuthentication.stopAuthentication(),
- throwsUnimplementedError);
+ test('stopAuthentication returns false', () async {
+ final bool result = await localAuthentication.stopAuthentication();
+ expect(result, false);
});
group('With device auth fail over', () {