Flutter 在颤振中完成验证时,HelperText将消失
我需要在TextFormField下添加信息文本,我已经在TextFormField中添加了帮助器文本 我面临一个问题, 如果我没有在TextFormField中输入文本,并在验证完成后单击submit,则错误文本将出现,helpertext将消失。即使出现错误文本,我也希望helpertext出现在那里 有没有办法做到这一点?或任何其他在textformfield下添加文本的解决方案,如超文本Flutter 在颤振中完成验证时,HelperText将消失,flutter,dart,flutter-layout,mobile-development,flutter-form-builder,Flutter,Dart,Flutter Layout,Mobile Development,Flutter Form Builder,我需要在TextFormField下添加信息文本,我已经在TextFormField中添加了帮助器文本 我面临一个问题, 如果我没有在TextFormField中输入文本,并在验证完成后单击submit,则错误文本将出现,helpertext将消失。即使出现错误文本,我也希望helpertext出现在那里 有没有办法做到这一点?或任何其他在textformfield下添加文本的解决方案,如超文本 TextFormField( decoration: InputDe
TextFormField(
decoration: InputDecoration(
helperText:
'This May Include: \n1) House Rent or Loan EMI. \n2) Utilities Bills (Telephone, Broadband, Water). \n3) Education, Grocery, Home Helps. ',
helperStyle: TextStyle(
color: Colors.brown,
fontSize: 13,
fontWeight: FontWeight.bold,
),
labelText: 'Current Monthly Expenses Total',
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 1.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black38, width: 1.0),
),
errorBorder: new OutlineInputBorder(
borderSide: new BorderSide(color: Colors.red, width: 1.0),
),
focusedErrorBorder: new OutlineInputBorder(
borderSide: new BorderSide(color: Colors.red, width: 1.0),
),
),
keyboardType: TextInputType.number,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter current monthly expenses';
}
return null;
},
onSaved: (value) {
//print(value);
inflationRate = value.toString();
//double.parse(value);
},
),