You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
401B

  1. import 'package:formz/formz.dart';
  2. enum PasswordValidationError { empty }
  3. class Password extends FormzInput<String, PasswordValidationError> {
  4. const Password.pure() : super.pure('');
  5. const Password.dirty([String value = '']) : super.dirty(value);
  6. @override
  7. PasswordValidationError validator(String value) {
  8. return value?.isNotEmpty == true ? null : PasswordValidationError.empty;
  9. }
  10. }