forked from eatvio/eatvio_app
feature(registration): refactor i 3.
This commit is contained in:
@@ -197,58 +197,58 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
||||
|
||||
bool canGoNext(state) {
|
||||
switch (step) {
|
||||
// case 2:
|
||||
// List<String> errors = validateCredentialsFields(state.sheet.email, state.sheet.name, state.sheet.password, state.sheet.passwordConfirmation);
|
||||
// if (errors.isEmpty) {
|
||||
// return true;
|
||||
// } else {
|
||||
// String errorMessage = '';
|
||||
//
|
||||
// for (var error in errors) {
|
||||
// errorMessage += error + '\n\n';
|
||||
// }
|
||||
//
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (context) => AlertDialog(
|
||||
// title: Text('Ошибка'),
|
||||
// content: Text(errorMessage),
|
||||
// actions: [
|
||||
// TextButton(
|
||||
// onPressed: () => Navigator.pop(context),
|
||||
// child: Text('OK'),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// return false;
|
||||
// }
|
||||
// case 3:
|
||||
// List<String> errors = validateNameFields(state.sheet.firstName, state.sheet.lastName);
|
||||
// if (errors.isEmpty) {
|
||||
// return true;
|
||||
// } else {
|
||||
// String errorMessage = '';
|
||||
//
|
||||
// for (var error in errors) {
|
||||
// errorMessage += error + '\n\n';
|
||||
// }
|
||||
//
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (context) => AlertDialog(
|
||||
// title: Text('Ошибка'),
|
||||
// content: Text(errorMessage),
|
||||
// actions: [
|
||||
// TextButton(
|
||||
// onPressed: () => Navigator.pop(context),
|
||||
// child: Text('OK'),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// return false;
|
||||
// }
|
||||
case 2:
|
||||
List<String> errors = validateCredentialsFields(state.sheet.email, state.sheet.name, state.sheet.password, state.sheet.passwordConfirmation);
|
||||
if (errors.isEmpty) {
|
||||
return true;
|
||||
} else {
|
||||
String errorMessage = '';
|
||||
|
||||
for (var error in errors) {
|
||||
errorMessage += error + '\n\n';
|
||||
}
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text('Ошибка'),
|
||||
content: Text(errorMessage),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text('OK'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return false;
|
||||
}
|
||||
case 3:
|
||||
List<String> errors = validateNameFields(state.sheet.firstName, state.sheet.lastName);
|
||||
if (errors.isEmpty) {
|
||||
return true;
|
||||
} else {
|
||||
String errorMessage = '';
|
||||
|
||||
for (var error in errors) {
|
||||
errorMessage += error + '\n\n';
|
||||
}
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text('Ошибка'),
|
||||
content: Text(errorMessage),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text('OK'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user