TF-233 Add mailbox name validator

This commit is contained in:
dab246
2022-02-22 16:04:12 +07:00
committed by Dat H. Pham
parent eec37295c8
commit 8f356a4ee3
19 changed files with 318 additions and 15 deletions
@@ -0,0 +1,33 @@
import 'package:equatable/equatable.dart';
abstract class VerifyNameException extends Equatable implements Exception {
static const EmptyName = 'The name cannot be empty!';
static const DuplicatedName = 'The name already exists!';
static const NameContainSpecialCharacter = 'The name cannot contain special characters';
final String? message;
VerifyNameException(this.message);
}
class EmptyNameException extends VerifyNameException {
EmptyNameException() : super(VerifyNameException.EmptyName);
@override
List<Object> get props => [];
}
class DuplicatedNameException extends VerifyNameException {
DuplicatedNameException() : super(VerifyNameException.DuplicatedName);
@override
List<Object> get props => [];
}
class SpecialCharacterException extends VerifyNameException {
SpecialCharacterException() : super(VerifyNameException.NameContainSpecialCharacter);
@override
List<Object> get props => [];
}