diff --git a/gallery/gallery/lib/codeviewer/code_segments.dart b/gallery/gallery/lib/codeviewer/code_segments.dart index 539035d133e..a35048d1527 100644 --- a/gallery/gallery/lib/codeviewer/code_segments.dart +++ b/gallery/gallery/lib/codeviewer/code_segments.dart @@ -27869,7 +27869,7 @@ class CodeSegments { text: '\u000a prefixText'), TextSpan(style: codeStyle.punctuationStyle, text: ':'), TextSpan(style: codeStyle.baseStyle, text: ' '), - TextSpan(style: codeStyle.stringStyle, text: '\u0027+1\u0027'), + TextSpan(style: codeStyle.stringStyle, text: '\u0027+1 \u0027'), TextSpan(style: codeStyle.punctuationStyle, text: ','), TextSpan(style: codeStyle.baseStyle, text: '\u000a '), TextSpan(style: codeStyle.punctuationStyle, text: '),'), @@ -27900,6 +27900,20 @@ class CodeSegments { TextSpan(style: codeStyle.punctuationStyle, text: ';'), TextSpan(style: codeStyle.baseStyle, text: '\u000a '), TextSpan(style: codeStyle.punctuationStyle, text: '},'), + TextSpan( + style: codeStyle.baseStyle, + text: '\u000a maxLength'), + TextSpan(style: codeStyle.punctuationStyle, text: ':'), + TextSpan(style: codeStyle.baseStyle, text: ' '), + TextSpan(style: codeStyle.numberStyle, text: '14'), + TextSpan(style: codeStyle.punctuationStyle, text: ','), + TextSpan( + style: codeStyle.baseStyle, + text: '\u000a maxLengthEnforced'), + TextSpan(style: codeStyle.punctuationStyle, text: ':'), + TextSpan(style: codeStyle.baseStyle, text: ' '), + TextSpan(style: codeStyle.keywordStyle, text: 'false'), + TextSpan(style: codeStyle.punctuationStyle, text: ','), TextSpan( style: codeStyle.baseStyle, text: '\u000a validator'), @@ -28179,20 +28193,6 @@ class CodeSegments { TextSpan(style: codeStyle.punctuationStyle, text: ').'), TextSpan(style: codeStyle.baseStyle, text: 'demoTextFieldUSD'), TextSpan(style: codeStyle.punctuationStyle, text: ','), - TextSpan( - style: codeStyle.baseStyle, - text: '\u000a suffixStyle'), - TextSpan(style: codeStyle.punctuationStyle, text: ':'), - TextSpan(style: codeStyle.baseStyle, text: ' '), - TextSpan(style: codeStyle.classStyle, text: 'TextStyle'), - TextSpan(style: codeStyle.punctuationStyle, text: '('), - TextSpan(style: codeStyle.baseStyle, text: 'color'), - TextSpan(style: codeStyle.punctuationStyle, text: ':'), - TextSpan(style: codeStyle.baseStyle, text: ' '), - TextSpan(style: codeStyle.classStyle, text: 'Colors'), - TextSpan(style: codeStyle.punctuationStyle, text: '.'), - TextSpan(style: codeStyle.baseStyle, text: 'green'), - TextSpan(style: codeStyle.punctuationStyle, text: '),'), TextSpan(style: codeStyle.baseStyle, text: '\u000a '), TextSpan(style: codeStyle.punctuationStyle, text: '),'), TextSpan( diff --git a/gallery/gallery/lib/demos/material/text_field_demo.dart b/gallery/gallery/lib/demos/material/text_field_demo.dart index 5413549fa40..cc102cf86e6 100644 --- a/gallery/gallery/lib/demos/material/text_field_demo.dart +++ b/gallery/gallery/lib/demos/material/text_field_demo.dart @@ -209,12 +209,14 @@ class TextFormFieldDemoState extends State { .demoTextFieldWhereCanWeReachYou, labelText: GalleryLocalizations.of(context) .demoTextFieldPhoneNumber, - prefixText: '+1', + prefixText: '+1 ', ), keyboardType: TextInputType.phone, onSaved: (value) { person.phoneNumber = value; }, + maxLength: 14, + maxLengthEnforced: false, validator: _validatePhoneNumber, // TextInputFormatters are applied in sequence. inputFormatters: [ @@ -263,7 +265,6 @@ class TextFormFieldDemoState extends State { GalleryLocalizations.of(context).demoTextFieldSalary, suffixText: GalleryLocalizations.of(context).demoTextFieldUSD, - suffixStyle: TextStyle(color: Colors.green), ), maxLines: 1, ),