Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 980cf40

Browse files
authored
[local_auth] Change stopAuthentication to return false instead of throwing on iOS. (#5249)
1 parent ace5709 commit 980cf40

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.1
2+
3+
* BREAKING CHANGE: Changes `stopAuthentication` to always return false instead of throwing an error.
4+
15
## 1.0.0
26

37
* Initial release from migration to federated architecture.

packages/local_auth/local_auth_ios/lib/local_auth_ios.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ class LocalAuthIOS extends LocalAuthPlatform {
8181
Future<bool> isDeviceSupported() async =>
8282
(await _channel.invokeMethod<bool>('isDeviceSupported')) ?? false;
8383

84+
/// Always returns false as this method is not supported on iOS.
8485
@override
8586
Future<bool> stopAuthentication() async {
86-
throw UnimplementedError('stopAuthentication() is not supported on iOS.');
87+
return false;
8788
}
8889
}

packages/local_auth/local_auth_ios/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: local_auth_ios
22
description: iOS implementation of the local_auth plugin.
33
repository: https://github.com/flutter/plugins/tree/master/packages/local_auth/local_auth_ios
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22
5-
version: 1.0.0
5+
version: 1.0.1
66

77
environment:
88
sdk: ">=2.14.0 <3.0.0"

packages/local_auth/local_auth_ios/test/local_auth_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ void main() {
7575
);
7676
});
7777

78-
test('stopAuthentication throws UnimplementedError', () async {
79-
expect(() async => await localAuthentication.stopAuthentication(),
80-
throwsUnimplementedError);
78+
test('stopAuthentication returns false', () async {
79+
final bool result = await localAuthentication.stopAuthentication();
80+
expect(result, false);
8181
});
8282

8383
group('With device auth fail over', () {

0 commit comments

Comments
 (0)