Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Typo fix
  • Loading branch information
stuartmorgan-g committed May 18, 2023
commit 97948518d5730c62f6784933ae5cfe9524fb3c05
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ - (void)testSuccessfullAuthWithBiometrics {
XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"];
[plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:@YES
sticky:@NO
useErrorDialgs:@NO]
useErrorDialogs:@NO]
strings:strings
completion:^(FLAAuthResultDetails *_Nullable result,
FlutterError *_Nullable error) {
Expand Down Expand Up @@ -113,7 +113,7 @@ - (void)testSuccessfullAuthWithoutBiometrics {
XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"];
[plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:@NO
sticky:@NO
useErrorDialgs:@NO]
useErrorDialogs:@NO]
strings:strings
completion:^(FLAAuthResultDetails *_Nullable result,
FlutterError *_Nullable error) {
Expand Down Expand Up @@ -151,7 +151,7 @@ - (void)testFailedAuthWithBiometrics {
XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"];
[plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:@YES
sticky:@NO
useErrorDialgs:@NO]
useErrorDialogs:@NO]
strings:strings
completion:^(FLAAuthResultDetails *_Nullable result,
FlutterError *_Nullable error) {
Expand Down Expand Up @@ -193,7 +193,7 @@ - (void)testFailedWithUnknownErrorCode {
XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"];
[plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:@NO
sticky:@NO
useErrorDialgs:@NO]
useErrorDialogs:@NO]
strings:strings
completion:^(FLAAuthResultDetails *_Nullable result,
FlutterError *_Nullable error) {
Expand Down Expand Up @@ -231,7 +231,7 @@ - (void)testSystemCancelledWithoutStickyAuth {
XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"];
[plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:@NO
sticky:@NO
useErrorDialgs:@NO]
useErrorDialogs:@NO]
strings:strings
completion:^(FLAAuthResultDetails *_Nullable result,
FlutterError *_Nullable error) {
Expand Down Expand Up @@ -269,7 +269,7 @@ - (void)testFailedAuthWithoutBiometrics {
XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"];
[plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:@NO
sticky:@NO
useErrorDialgs:@NO]
useErrorDialogs:@NO]
strings:strings
completion:^(FLAAuthResultDetails *_Nullable result,
FlutterError *_Nullable error) {
Expand Down Expand Up @@ -312,7 +312,7 @@ - (void)testLocalizedFallbackTitle {
XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"];
[plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:@NO
sticky:@NO
useErrorDialgs:@NO]
useErrorDialogs:@NO]
strings:strings
completion:^(FLAAuthResultDetails *_Nullable result,
FlutterError *_Nullable error) {
Expand Down Expand Up @@ -350,7 +350,7 @@ - (void)testSkippedLocalizedFallbackTitle {
XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"];
[plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:@NO
sticky:@NO
useErrorDialgs:@NO]
useErrorDialogs:@NO]
strings:strings
completion:^(FLAAuthResultDetails *_Nullable result,
FlutterError *_Nullable error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ - (void)handleError:(NSError *)authError
switch (authError.code) {
case LAErrorPasscodeNotSet:
case LAErrorBiometryNotEnrolled:
if (options.useErrorDialgs.boolValue) {
if (options.useErrorDialogs.boolValue) {
[self showAlertWithMessage:strings.goToSettingsDescription
firstButton:strings.cancelButton
additionalButton:strings.goToSettingsButton
Expand Down
4 changes: 2 additions & 2 deletions packages/local_auth/local_auth_ios/ios/Classes/messages.g.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ typedef NS_ENUM(NSUInteger, FLAAuthBiometric) {
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithBiometricOnly:(NSNumber *)biometricOnly
sticky:(NSNumber *)sticky
useErrorDialgs:(NSNumber *)useErrorDialgs;
useErrorDialogs:(NSNumber *)useErrorDialogs;
@property(nonatomic, strong) NSNumber *biometricOnly;
@property(nonatomic, strong) NSNumber *sticky;
@property(nonatomic, strong) NSNumber *useErrorDialgs;
@property(nonatomic, strong) NSNumber *useErrorDialogs;
@end

@interface FLAAuthResultDetails : NSObject
Expand Down
10 changes: 5 additions & 5 deletions packages/local_auth/local_auth_ios/ios/Classes/messages.g.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ - (NSArray *)toList {
@implementation FLAAuthOptions
+ (instancetype)makeWithBiometricOnly:(NSNumber *)biometricOnly
sticky:(NSNumber *)sticky
useErrorDialgs:(NSNumber *)useErrorDialgs {
useErrorDialogs:(NSNumber *)useErrorDialogs {
FLAAuthOptions *pigeonResult = [[FLAAuthOptions alloc] init];
pigeonResult.biometricOnly = biometricOnly;
pigeonResult.sticky = sticky;
pigeonResult.useErrorDialgs = useErrorDialgs;
pigeonResult.useErrorDialogs = useErrorDialogs;
return pigeonResult;
}
+ (FLAAuthOptions *)fromList:(NSArray *)list {
Expand All @@ -110,8 +110,8 @@ + (FLAAuthOptions *)fromList:(NSArray *)list {
NSAssert(pigeonResult.biometricOnly != nil, @"");
pigeonResult.sticky = GetNullableObjectAtIndex(list, 1);
NSAssert(pigeonResult.sticky != nil, @"");
pigeonResult.useErrorDialgs = GetNullableObjectAtIndex(list, 2);
NSAssert(pigeonResult.useErrorDialgs != nil, @"");
pigeonResult.useErrorDialogs = GetNullableObjectAtIndex(list, 2);
NSAssert(pigeonResult.useErrorDialogs != nil, @"");
return pigeonResult;
}
+ (nullable FLAAuthOptions *)nullableFromList:(NSArray *)list {
Expand All @@ -121,7 +121,7 @@ - (NSArray *)toList {
return @[
(self.biometricOnly ?: [NSNull null]),
(self.sticky ?: [NSNull null]),
(self.useErrorDialgs ?: [NSNull null]),
(self.useErrorDialogs ?: [NSNull null]),
];
}
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LocalAuthIOS extends LocalAuthPlatform {
AuthOptions(
biometricOnly: options.biometricOnly,
sticky: options.stickyAuth,
useErrorDialgs: options.useErrorDialogs),
useErrorDialogs: options.useErrorDialogs),
_pigeonStringsFromAuthMessages(localizedReason, authMessages));
// TODO(stuartmorgan): Replace this with structured errors, coordinated
// across all platform implementations, per
Expand Down
8 changes: 4 additions & 4 deletions packages/local_auth/local_auth_ios/lib/src/messages.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,20 @@ class AuthOptions {
AuthOptions({
required this.biometricOnly,
required this.sticky,
required this.useErrorDialgs,
required this.useErrorDialogs,
});

bool biometricOnly;

bool sticky;

bool useErrorDialgs;
bool useErrorDialogs;

Object encode() {
return <Object?>[
biometricOnly,
sticky,
useErrorDialgs,
useErrorDialogs,
];
}

Expand All @@ -110,7 +110,7 @@ class AuthOptions {
return AuthOptions(
biometricOnly: result[0]! as bool,
sticky: result[1]! as bool,
useErrorDialgs: result[2]! as bool,
useErrorDialogs: result[2]! as bool,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/local_auth/local_auth_ios/pigeons/messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class AuthOptions {
AuthOptions(
{required this.biometricOnly,
required this.sticky,
required this.useErrorDialgs});
required this.useErrorDialogs});
final bool biometricOnly;
final bool sticky;
final bool useErrorDialgs;
final bool useErrorDialogs;
}

class AuthResultDetails {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void main() {
final AuthOptions options = result.captured[0] as AuthOptions;
expect(options.biometricOnly, false);
expect(options.sticky, false);
expect(options.useErrorDialgs, true);
expect(options.useErrorDialogs, true);
});

test('passes provided non-default values', () async {
Expand All @@ -234,7 +234,7 @@ void main() {
final AuthOptions options = result.captured[0] as AuthOptions;
expect(options.biometricOnly, true);
expect(options.sticky, true);
expect(options.useErrorDialgs, false);
expect(options.useErrorDialogs, false);
});
});

Expand Down