Skip to content

Commit b2d1055

Browse files
Dillon Nysragingsquirrel3
authored andcommitted
docs(auth): Remove unnecessary breaks
1 parent da89403 commit b2d1055

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

packages/amplify_core/doc/lib/auth.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ Future<void> _handleSignUpResult(SignUpResult result) async {
3838
case AuthSignUpStep.confirmSignUp:
3939
final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
4040
_handleCodeDelivery(codeDeliveryDetails);
41-
break;
4241
case AuthSignUpStep.done:
4342
safePrint('Sign up is complete');
44-
break;
4543
}
4644
}
4745
// #enddocregion handle-signup
@@ -114,27 +112,23 @@ Future<void> _handleSignInResult(SignInResult result) async {
114112
case AuthSignInStep.confirmSignInWithSmsMfaCode:
115113
final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
116114
_handleCodeDelivery(codeDeliveryDetails);
117-
break;
118115
// #enddocregion handle-confirm-signin-sms
119116
// #docregion handle-confirm-signin-new-password
120117
case AuthSignInStep.confirmSignInWithNewPassword:
121118
safePrint('Enter a new password to continue signing in');
122-
break;
123119
// #enddocregion handle-confirm-signin-new-password
124120
// #docregion handle-confirm-signin-custom-challenge
125121
case AuthSignInStep.confirmSignInWithCustomChallenge:
126122
final parameters = result.nextStep.additionalInfo;
127123
final prompt = parameters['prompt']!;
128124
safePrint(prompt);
129-
break;
130125
// #enddocregion handle-confirm-signin-custom-challenge
131126
// #docregion handle-confirm-signin-reset-password
132127
case AuthSignInStep.resetPassword:
133128
final resetResult = await Amplify.Auth.resetPassword(
134129
username: username,
135130
);
136131
await _handleResetPasswordResult(resetResult);
137-
break;
138132
// #enddocregion handle-confirm-signin-reset-password
139133
// #docregion handle-confirm-signin-confirm-signup
140134
case AuthSignInStep.confirmSignUp:
@@ -143,12 +137,10 @@ Future<void> _handleSignInResult(SignInResult result) async {
143137
username: username,
144138
);
145139
_handleCodeDelivery(resendResult.codeDeliveryDetails);
146-
break;
147140
// #enddocregion handle-confirm-signin-confirm-signup
148141
// #docregion handle-confirm-signin-done
149142
case AuthSignInStep.done:
150143
safePrint('Sign in is complete');
151-
break;
152144
// #enddocregion handle-confirm-signin-done
153145
// #docregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done
154146
}
@@ -188,10 +180,8 @@ Future<void> _handleResetPasswordResult(ResetPasswordResult result) async {
188180
case AuthResetPasswordStep.confirmResetPasswordWithCode:
189181
final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
190182
_handleCodeDelivery(codeDeliveryDetails);
191-
break;
192183
case AuthResetPasswordStep.done:
193184
safePrint('Successfully reset password');
194-
break;
195185
}
196186
}
197187
// #enddocregion handle-reset-password
@@ -344,10 +334,8 @@ void _handleUpdateUserAttributeResult(
344334
case AuthUpdateAttributeStep.confirmAttributeWithCode:
345335
final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
346336
_handleCodeDelivery(codeDeliveryDetails);
347-
break;
348337
case AuthUpdateAttributeStep.done:
349338
safePrint('Successfully updated attribute');
350-
break;
351339
}
352340
}
353341
// #enddocregion handle-update-user-attribute
@@ -389,10 +377,8 @@ Future<void> updateUserAttributes() async {
389377
case AuthUpdateAttributeStep.confirmAttributeWithCode:
390378
final destination = value.nextStep.codeDeliveryDetails?.destination;
391379
safePrint('Confirmation code sent to $destination for $key');
392-
break;
393380
case AuthUpdateAttributeStep.done:
394381
safePrint('Update completed for $key');
395-
break;
396382
}
397383
});
398384
} on AuthException catch (e) {

packages/amplify_core/lib/src/category/amplify_auth_category.dart

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
109109
/// case AuthSignUpStep.confirmSignUp:
110110
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
111111
/// _handleCodeDelivery(codeDeliveryDetails);
112-
/// break;
113112
/// case AuthSignUpStep.done:
114113
/// safePrint('Sign up is complete');
115-
/// break;
116114
/// }
117115
/// }
118116
/// ```
@@ -190,10 +188,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
190188
/// case AuthSignUpStep.confirmSignUp:
191189
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
192190
/// _handleCodeDelivery(codeDeliveryDetails);
193-
/// break;
194191
/// case AuthSignUpStep.done:
195192
/// safePrint('Sign up is complete');
196-
/// break;
197193
/// }
198194
/// }
199195
/// ```
@@ -337,7 +333,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
337333
/// case AuthSignInStep.confirmSignInWithSmsMfaCode:
338334
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
339335
/// _handleCodeDelivery(codeDeliveryDetails);
340-
/// break;
341336
/// // ···
342337
/// }
343338
/// }
@@ -363,7 +358,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
363358
/// // ···
364359
/// case AuthSignInStep.confirmSignInWithNewPassword:
365360
/// safePrint('Enter a new password to continue signing in');
366-
/// break;
367361
/// // ···
368362
/// }
369363
/// }
@@ -383,7 +377,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
383377
/// final parameters = result.nextStep.additionalInfo;
384378
/// final prompt = parameters['prompt']!;
385379
/// safePrint(prompt);
386-
/// break;
387380
/// // ···
388381
/// }
389382
/// }
@@ -403,7 +396,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
403396
/// username: username,
404397
/// );
405398
/// await _handleResetPasswordResult(resetResult);
406-
/// break;
407399
/// // ···
408400
/// }
409401
/// }
@@ -416,10 +408,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
416408
/// case AuthResetPasswordStep.confirmResetPasswordWithCode:
417409
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
418410
/// _handleCodeDelivery(codeDeliveryDetails);
419-
/// break;
420411
/// case AuthResetPasswordStep.done:
421412
/// safePrint('Successfully reset password');
422-
/// break;
423413
/// }
424414
/// }
425415
/// ```
@@ -439,7 +429,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
439429
/// username: username,
440430
/// );
441431
/// _handleCodeDelivery(resendResult.codeDeliveryDetails);
442-
/// break;
443432
/// // ···
444433
/// }
445434
/// }
@@ -465,7 +454,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
465454
/// // ···
466455
/// case AuthSignInStep.done:
467456
/// safePrint('Sign in is complete');
468-
/// break;
469457
/// // ···
470458
/// }
471459
/// }
@@ -704,10 +692,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
704692
/// case AuthResetPasswordStep.confirmResetPasswordWithCode:
705693
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
706694
/// _handleCodeDelivery(codeDeliveryDetails);
707-
/// break;
708695
/// case AuthResetPasswordStep.done:
709696
/// safePrint('Successfully reset password');
710-
/// break;
711697
/// }
712698
/// }
713699
/// ```
@@ -1045,10 +1031,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
10451031
/// case AuthUpdateAttributeStep.confirmAttributeWithCode:
10461032
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
10471033
/// _handleCodeDelivery(codeDeliveryDetails);
1048-
/// break;
10491034
/// case AuthUpdateAttributeStep.done:
10501035
/// safePrint('Successfully updated attribute');
1051-
/// break;
10521036
/// }
10531037
/// }
10541038
/// ```
@@ -1108,10 +1092,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
11081092
/// case AuthUpdateAttributeStep.confirmAttributeWithCode:
11091093
/// final destination = value.nextStep.codeDeliveryDetails?.destination;
11101094
/// safePrint('Confirmation code sent to $destination for $key');
1111-
/// break;
11121095
/// case AuthUpdateAttributeStep.done:
11131096
/// safePrint('Update completed for $key');
1114-
/// break;
11151097
/// }
11161098
/// });
11171099
/// } on AuthException catch (e) {

0 commit comments

Comments
 (0)