-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into develop
- Loading branch information
Showing
8 changed files
with
75 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
lib/src/presentation/pages/home_page/sub_pages/reset_password_page.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
class Errors { | ||
static const Messages = {1: 'Datos inválidos.', 2: 'Credenciales inválidas.'}; | ||
static const Messages = { | ||
1: 'Datos inválidos.', | ||
2: 'Credenciales inválidas.', | ||
20: 'Datos inválidos.', | ||
}; | ||
|
||
static const DefaultError = 'Ha ocurrido un error.'; | ||
|
||
static const ConnectionError = 'Conexión fallida. Verifique su conectividad.'; | ||
|
||
static String? retrieveError(String message) { | ||
try { | ||
final index = int.parse(message); | ||
return Messages[index]; | ||
} catch (_) {} | ||
|
||
return DefaultError; | ||
final index = int.tryParse(message); | ||
return index != null && Messages.containsKey(index) | ||
? Messages[index] | ||
: DefaultError; | ||
} | ||
} |