mirror of
https://github.com/Linloir/Simple-TCP-Client.git
synced 2025-12-17 00:38:11 +08:00
21 lines
530 B
Dart
21 lines
530 B
Dart
/*
|
|
* @Author : Linloir
|
|
* @Date : 2022-10-12 15:37:29
|
|
* @LastEditTime : 2022-10-12 15:46:38
|
|
* @Description :
|
|
*/
|
|
|
|
import 'package:formz/formz.dart';
|
|
|
|
enum PasswordValidationError { empty }
|
|
|
|
class Password extends FormzInput<String, PasswordValidationError> {
|
|
const Password.pure() : super.pure('');
|
|
const Password.dirty([super.value = '']) : super.dirty();
|
|
|
|
@override
|
|
PasswordValidationError? validator(String? value) {
|
|
return value?.isNotEmpty == true ? null : PasswordValidationError.empty;
|
|
}
|
|
}
|