edit profile bug fixed
This commit is contained in:
parent
60927b8b4c
commit
903bc65b67
|
|
@ -100,13 +100,15 @@ class _ProfileState extends State<Profile> {
|
||||||
email = value;
|
email = value;
|
||||||
},
|
},
|
||||||
initialValue: state.user.email,
|
initialValue: state.user.email,
|
||||||
validator: (value) async {
|
validator: (value) {
|
||||||
|
if (value.isEmpty) return null;
|
||||||
bool emailValid = RegExp(
|
bool emailValid = RegExp(
|
||||||
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
|
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
|
||||||
.hasMatch(value);
|
.hasMatch(value);
|
||||||
if (!emailValid) {
|
if (!emailValid) {
|
||||||
return 'ایمیل وارد شده معتبر نمیباشد';
|
return 'ایمیل وارد شده معتبر نمیباشد';
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
// const SizedBox(height: 16),
|
// const SizedBox(height: 16),
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class DidvanTextField extends StatefulWidget {
|
||||||
final dynamic initialValue;
|
final dynamic initialValue;
|
||||||
final bool obsecureText;
|
final bool obsecureText;
|
||||||
final bool acceptSpace;
|
final bool acceptSpace;
|
||||||
final Function(String value)? validator;
|
final String? Function(String value)? validator;
|
||||||
final TextInputType? textInputType;
|
final TextInputType? textInputType;
|
||||||
const DidvanTextField({
|
const DidvanTextField({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue