Skip to content

Commit 25a417a

Browse files
committed
refactor(authenticator): improve comments and streamline state assignment in tests
1 parent 5c5157a commit 25a417a

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

packages/authenticator/amplify_authenticator/lib/src/widgets/form_field.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ abstract class AuthenticatorFormFieldState<
198198
/// Whether the form field accepts input.
199199
bool get enabled => true;
200200

201-
/// Effective enabled state that combines [enabled] with [widget.enabledOverride].
201+
/// Effective enabled state that combines [enabled] with [enabledOverride].
202202
///
203203
/// Subclasses can override [enabled] to provide custom logic for determining
204204
/// the default enabled state. This property ensures the override is respected.
@@ -371,9 +371,7 @@ abstract class AuthenticatorFormFieldState<
371371
..add(StringProperty('labelText', labelText))
372372
..add(DiagnosticsProperty<double?>('marginBottom', marginBottom))
373373
..add(DoubleProperty('labelGap', labelGap))
374-
..add(IterableProperty<String>('autofillHints', autofillHints));
375-
properties.add(
376-
DiagnosticsProperty<bool>('effectiveEnabled', effectiveEnabled),
377-
);
374+
..add(IterableProperty<String>('autofillHints', autofillHints))
375+
..add(DiagnosticsProperty<bool>('effectiveEnabled', effectiveEnabled));
378376
}
379377
}

packages/authenticator/amplify_authenticator/test/form_field_controller_test.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,9 @@ void main() {
461461
await tester.pumpAndSettle();
462462

463463
final signUpContext = tester.element(find.byType(SignUpForm));
464-
var authState = InheritedAuthenticatorState.of(signUpContext);
465-
466-
// Set state value
467-
authState.address = 'Initial Address';
464+
var authState = InheritedAuthenticatorState.of(signUpContext)
465+
// Set state value
466+
..address = 'Initial Address';
468467
await tester.pump();
469468

470469
// Rebuild with controller

0 commit comments

Comments
 (0)