如何更改 TextFormField 验证错误消息的对齐方式?
TextFormField(
textAlign: TextAlign.center,
decoration: const InputDecoration(
errorStyle: TextStyle(
fontSize: 16.0,
),
),
validator: (value) {
if (value.isEmpty) {
return 'Please enter some text';
}
return null;
},
),
电流输出:
预期输出: