Skip to content

Commit

Permalink
fix(authenticator): Beta channel fixes (#3835)
Browse files Browse the repository at this point in the history
  • Loading branch information
Equartey authored Sep 27, 2023
1 parent d8f4c7b commit 542bd3e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0

import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:flutter/foundation.dart';

enum ConfirmSignInField {
code,
Expand Down Expand Up @@ -39,8 +38,7 @@ extension ConfirmSignInFieldX on ConfirmSignInField {
case ConfirmSignInField.mfaMethod:
throw StateError('Can only be called on attribute types');
default:
final key =
describeEnum(this).replaceAllMapped(RegExp(r'[A-Z]'), (match) {
final key = name.replaceAllMapped(RegExp(r'[A-Z]'), (match) {
return '_${match.group(0)!.toLowerCase()}';
});
return CognitoUserAttributeKey.parse(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0

import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:flutter/foundation.dart';

enum SignUpField {
username,
Expand Down Expand Up @@ -37,8 +36,7 @@ extension SignUpFieldX on SignUpField {
case SignUpField.custom:
throw StateError('Can only be called on attribute types');
default:
final key =
describeEnum(this).replaceAllMapped(RegExp(r'[A-Z]'), (match) {
final key = name.replaceAllMapped(RegExp(r'[A-Z]'), (match) {
return '_${match.group(0)!.toLowerCase()}';
});
return CognitoUserAttributeKey.parse(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import 'package:amplify_authenticator/amplify_authenticator.dart';
import 'package:amplify_authenticator/src/l10n/authenticator_localizations.dart';
import 'package:amplify_authenticator/src/l10n/resolver.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

enum ButtonResolverKeyType {
Expand Down Expand Up @@ -67,7 +66,7 @@ class ButtonResolverKey {
static const copyKey = ButtonResolverKey._(ButtonResolverKeyType.copyKey);

@override
String toString() => describeEnum(type);
String toString() => type.name;
}

/// The resolver class for shared button Widgets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class _AuthenticatorCheckBoxState<T extends AuthenticatorCheckbox<T>>
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(EnumProperty('onChanged', onChanged));
properties.add(DiagnosticsProperty<Function>('onChanged', onChanged));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ class _SignInFormState extends AuthenticatorFormState<SignInForm> {
} else if (b == SocialProvider.apple) {
return 1;
}
return describeEnum(a).compareTo(describeEnum(b));
return a.name.compareTo(b.name);
});

return [
Expand Down
2 changes: 1 addition & 1 deletion packages/authenticator/amplify_authenticator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dev_dependencies:
build_version: ^2.1.1
flutter_test:
sdk: flutter
golden_toolkit: ^0.13.0
golden_toolkit: ^0.15.0
mocktail: ^1.0.0
path: any

Expand Down

0 comments on commit 542bd3e

Please sign in to comment.