Aidra Driver
1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
validation_exception.dart
Go to the documentation of this file.
1
import
'app_exception.dart';
2
3
class
ValidationException
extends
AppException
{
4
const
ValidationException
({
5
required super.message,
6
super.code,
7
super.details,
8
});
9
10
factory
ValidationException
.invalidEmail() {
11
return
const
ValidationException
(
12
message
:
'Invalid email format'
,
13
code:
'VALIDATION_INVALID_EMAIL'
,
14
);
15
}
16
17
factory
ValidationException
.invalidPhone() {
18
return
const
ValidationException
(
19
message
:
'Invalid phone number'
,
20
code:
'VALIDATION_INVALID_PHONE'
,
21
);
22
}
23
24
factory
ValidationException
.invalidPassword() {
25
return
const
ValidationException
(
26
message
:
'Password must be at least 8 characters'
,
27
code:
'VALIDATION_INVALID_PASSWORD'
,
28
);
29
}
30
31
factory
ValidationException
.requiredField(
String
fieldName) {
32
return
ValidationException
(
33
message
:
'$fieldName is required'
,
34
code:
'VALIDATION_REQUIRED_FIELD'
,
35
details: {
'field'
: fieldName},
36
);
37
}
38
}
AppException
Definition
auth_exception.dart:3
AppException::ValidationException
const ValidationException({ required super.message, super.code, super.details, })
String
class Partner String
message
final String message
Definition
failures.dart:0
lib
core
error
exceptipns
validation_exception.dart
Generated by
1.16.1