📜  在 Flutter 中创建验证器 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:04.603000             🧑  作者: Mango

代码示例1
TextFormField(
  // The validator receives the text that the user has entered.
  validator: (value) {
    if (value.isEmpty) {
      return 'Please enter some text';
    }
    return null;
  },
);