From b267e7bd9baf7c2942b67c91ec925bea3a62c47d Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Fri, 10 Jul 2020 18:06:02 -0700 Subject: [PATCH] This fixes a compile error in the form field example, and switches to using space instead of enter as the example for moving to the next field, since the text field on web unfocuses automatically when enter is pressed. (#61123) --- packages/flutter/lib/src/material/text_form_field.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/flutter/lib/src/material/text_form_field.dart b/packages/flutter/lib/src/material/text_form_field.dart index f91a9cc011..9e5cda3b5b 100644 --- a/packages/flutter/lib/src/material/text_form_field.dart +++ b/packages/flutter/lib/src/material/text_form_field.dart @@ -82,9 +82,8 @@ export 'package:flutter/services.dart' show SmartQuotesType, SmartDashesType; /// child: Center( /// child: Shortcuts( /// shortcuts: { -/// // Pressing enter on the field will now move to the next field. -/// LogicalKeySet(LogicalKeyboardKey.enter): -/// NextFocusIntent(), +/// // Pressing space in the field will now move to the next field. +/// LogicalKeySet(LogicalKeyboardKey.space): const NextFocusIntent(), /// }, /// child: FocusTraversalGroup( /// child: Form( @@ -97,7 +96,7 @@ export 'package:flutter/services.dart' show SmartQuotesType, SmartDashesType; /// return Padding( /// padding: const EdgeInsets.all(8.0), /// child: ConstrainedBox( -/// constraints: BoxConstraints.tight(Size(200, 50)), +/// constraints: BoxConstraints.tight(const Size(200, 50)), /// child: TextFormField( /// onSaved: (String value) { /// print('Value for field $index saved as "$value"');