安装

  1. 将最新版本的包添加到您的 pubspec.yaml (并运行 dart pub get)

dependencies:
  validation_textformfield: Update version
  1. 导入包并在您的 Flutter 应用中使用它。

import 'package:validation_textformfield/validation_textformfield.dart';
    

用于启动验证 TextFormField 的 Flutter 包。支持
iOS、Android、Web、Windows、macOS 和 Linux。

示例

EmailValidationTextField(
 whenTextFieldEmpty: "Please enter  email",
 validatorMassage: "Please enter valid email",
 decoration: InputDecoration(
 focusedBorder: OutlineInputBorder(
 borderSide: BorderSide(color: Colors.black, width: 0.5),
),
 enabledBorder: OutlineInputBorder(
 borderSide: BorderSide(color: Colors.black, width: 0.5),
),
 border: OutlineInputBorder(),
 counterText: '',
 hintStyle: TextStyle(color: Colors.black, fontSize: 18.0)),
 textEditingController: txtEmailCtrl,
)

有关更复杂的示例,请参阅示例应用程序。

Image

Email

入门

要开始使用 Flutter,请参阅我们的在线
文档.

GitHub

查看 Github