TF-2934 Fix mailbox name with space only

This commit is contained in:
dab246
2024-08-05 13:26:05 +07:00
committed by Dat H. Pham
parent a3d17b3bb2
commit 43a44971c6
7 changed files with 81 additions and 11 deletions
@@ -6,36 +6,32 @@ abstract class VerifyNameException extends Equatable implements Exception {
static const duplicatedName = 'The name already exists!';
static const nameContainSpecialCharacter = 'The name cannot contain special characters';
static const emailAddressInvalid = 'The email address invalid';
static const spaceOnlyWithinName = 'The name cannot contain only spaces';
final String? message;
const VerifyNameException(this.message);
@override
List<Object?> get props => [message];
}
class EmptyNameException extends VerifyNameException {
const EmptyNameException() : super(VerifyNameException.emptyName);
@override
List<Object> get props => [];
}
class DuplicatedNameException extends VerifyNameException {
const DuplicatedNameException() : super(VerifyNameException.duplicatedName);
@override
List<Object> get props => [];
}
class SpecialCharacterException extends VerifyNameException {
const SpecialCharacterException() : super(VerifyNameException.nameContainSpecialCharacter);
@override
List<Object> get props => [];
}
class EmailAddressInvalidException extends VerifyNameException {
const EmailAddressInvalidException() : super(VerifyNameException.emailAddressInvalid);
}
@override
List<Object> get props => [];
class NameWithSpaceOnlyException extends VerifyNameException {
const NameWithSpaceOnlyException() : super(VerifyNameException.spaceOnlyWithinName);
}