mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
[Gallery] Text field demo fixes (#302)
* Misc text field demo fixes * Update code_segments.dart
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -215,6 +215,8 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
||||
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