Skip to content

Commit 257bc83

Browse files
authored
feat: bring sign up ux in line with other sdks [#246] (#270)
* feat: bring sign up ux in line with other sdks [#246] # Conflicts: # packages/clerk_flutter/lib/src/widgets/authentication/clerk_sign_up_panel.dart * fix: refactor the sign up panel build method [#246] * fix: refactors [#246] * fix: fix rebase discrepancies in sign up [#246]
1 parent 57ddd7f commit 257bc83

File tree

8 files changed

+243
-112
lines changed

8 files changed

+243
-112
lines changed

packages/clerk_auth/lib/src/models/enums.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ enum UserAttribute {
5656
/// password
5757
password,
5858

59+
/// password confirmation
60+
passwordConfirmation,
61+
5962
/// web3 wallet
6063
web3Wallet,
6164

packages/clerk_auth/lib/src/utils/extensions.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'dart:convert';
22

3+
import 'package:collection/collection.dart';
4+
35
/// Extension on [Object] useful for debugging
46
extension ObjectIdentity on Object {
57
/// Returns a summary of the runtime type and hash code of `object`.
@@ -77,6 +79,17 @@ extension ListExtension<T> on List<T> {
7779
}
7880
}
7981

82+
/// Remove and return the first item that satisfies the test, and update
83+
/// the list accordingly
84+
///
85+
T? removeFirstOrNull(bool Function(T) test) {
86+
if (firstWhereOrNull(test) case T item) {
87+
remove(item);
88+
return item;
89+
}
90+
return null;
91+
}
92+
8093
/// Do we contain a thing?
8194
bool doesNotContain(T t) => contains(t) == false;
8295
}

packages/clerk_flutter/l10n/en.arb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131
},
3232
"abandoned": "abandoned",
33-
"acceptTerms": "I accept the Terms & Conditions and Privacy Policy",
33+
"acceptTerms": "I agree to the Terms of Service and Privacy Policy",
3434
"actionNotTimely": "Awaited user action not completed in required timeframe",
3535
"active": "active",
3636
"addAccount": "Add account",
@@ -256,7 +256,7 @@
256256
"slug": "Slug",
257257
"slugUrl": "Slug URL",
258258
"switchTo": "Switch to",
259-
"termsAndConditions": "Terms & Conditions",
259+
"termsOfService": "Terms of Service",
260260
"transferable": "transferable",
261261
"typeTypeInvalid": "Type '{type}' is invalid",
262262
"@typeTypeInvalid": {

packages/clerk_flutter/lib/generated/clerk_sdk_localizations.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ abstract class ClerkSdkLocalizations {
135135
/// No description provided for @acceptTerms.
136136
///
137137
/// In en, this message translates to:
138-
/// **'I accept the Terms & Conditions and Privacy Policy'**
138+
/// **'I agree to the Terms of Service and Privacy Policy'**
139139
String get acceptTerms;
140140

141141
/// No description provided for @actionNotTimely.
@@ -816,11 +816,11 @@ abstract class ClerkSdkLocalizations {
816816
/// **'Switch to'**
817817
String get switchTo;
818818

819-
/// No description provided for @termsAndConditions.
819+
/// No description provided for @termsOfService.
820820
///
821821
/// In en, this message translates to:
822-
/// **'Terms & Conditions'**
823-
String get termsAndConditions;
822+
/// **'Terms of Service'**
823+
String get termsOfService;
824824

825825
/// No description provided for @transferable.
826826
///

packages/clerk_flutter/lib/generated/clerk_sdk_localizations_en.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ClerkSdkLocalizationsEn extends ClerkSdkLocalizations {
3434

3535
@override
3636
String get acceptTerms =>
37-
'I accept the Terms & Conditions and Privacy Policy';
37+
'I agree to the Terms of Service and Privacy Policy';
3838

3939
@override
4040
String get actionNotTimely =>
@@ -419,7 +419,7 @@ class ClerkSdkLocalizationsEn extends ClerkSdkLocalizations {
419419
String get switchTo => 'Switch to';
420420

421421
@override
422-
String get termsAndConditions => 'Terms & Conditions';
422+
String get termsOfService => 'Terms of Service';
423423

424424
@override
425425
String get transferable => 'transferable';

packages/clerk_flutter/lib/src/utils/localization_extensions.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ extension ClerkUserAttributeLocalization on clerk.UserAttribute {
130130
clerk.UserAttribute.firstName => l10ns.firstName,
131131
clerk.UserAttribute.lastName => l10ns.lastName,
132132
clerk.UserAttribute.password => l10ns.password,
133+
clerk.UserAttribute.passwordConfirmation => l10ns.passwordConfirmation,
133134
clerk.UserAttribute.web3Wallet => l10ns.web3Wallet,
134135
clerk.UserAttribute.authenticatorApp => l10ns.authenticatorApp,
135136
clerk.UserAttribute.backupCode => l10ns.backupCode,

0 commit comments

Comments
 (0)