mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
[Gallery] Text field demo fixes (#302)
* Misc text field demo fixes * Update code_segments.dart
This commit is contained in:
@@ -27879,7 +27879,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: '),'),
|
||||
@@ -27910,6 +27910,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'),
|
||||
@@ -28189,20 +28203,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(
|
||||
|
||||
@@ -209,12 +209,14 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
||||
.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: <TextInputFormatter>[
|
||||
@@ -263,7 +265,6 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
||||
GalleryLocalizations.of(context).demoTextFieldSalary,
|
||||
suffixText:
|
||||
GalleryLocalizations.of(context).demoTextFieldUSD,
|
||||
suffixStyle: TextStyle(color: Colors.green),
|
||||
),
|
||||
maxLines: 1,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user