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

[local_auth] Change stopAuthentication to return false instead of throwing on iOS. #5249

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/local_auth/local_auth_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case anyone (including me when I forget) is confused by this later: this is a minor version bump rather than a major version bump even though it lists a breaking change because we haven't started using this package yet. Since nobody is using 1.0.0, there's nobody to break.


* BREAKING CHANGE: Changes `stopAuthentication` to always return false instead of throwing an error.

## 1.0.0

* Initial release from migration to federated architecture.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ class LocalAuthIOS extends LocalAuthPlatform {
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;
}
}
2 changes: 1 addition & 1 deletion packages/local_auth/local_auth_ios/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: local_auth_ios
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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ void main() {
);
});

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', () {
Expand Down