validator_mixin.dart 310 B

123456789101112131415161718
  1. class LoginValidators {
  2. String validatePassword(String value) {
  3. if (value.length < 4) {
  4. return 'password should be longer 3';
  5. }
  6. return null;
  7. }
  8. String validateEmail(String value) {
  9. if (!value.contains('@')) {
  10. return 'please enter valid email';
  11. }
  12. return null;
  13. }
  14. }