change alert message

This commit is contained in:
2024-12-30 22:34:17 +01:00
parent 938b677b6e
commit 43d77f778b
7 changed files with 55 additions and 45 deletions

View File

@@ -52,7 +52,7 @@ class EditEvent extends StatefulWidget {
}
class _EditEventState extends State<EditEvent>
with ShowErrorDialog, ShowEventDialog {
with ShowAlertDialog, ShowEventDialog {
TextEditingController inputName = TextEditingController();
TextEditingController inputDate = TextEditingController();
@@ -208,7 +208,8 @@ class _EditEventState extends State<EditEvent>
var events = jsonDecode(utf8.decode(responseGet.bodyBytes));
if (events.length > 0) {
if (events[0]["id"] != widget.events!.id) {
showErrorDialog(context, "Evenement deja existant");
showAlertDialog(
context, "Info evenement", "Evenement deja existant");
}
return;
@@ -236,7 +237,7 @@ class _EditEventState extends State<EditEvent>
final status = res.statusCode;
print("code status imgbb ${status}");
if (status != 200) {
showErrorDialog(context, "Image non posté");
showAlertDialog(context, "Erreur image", "Image non posté");
return;
}
var body = json.decode(utf8.decode(res.bodyBytes));
@@ -306,22 +307,23 @@ class _EditEventState extends State<EditEvent>
}
break;
}
showErrorDialog(context, text);
showAlertDialog(context, "Erreur serveur", text);
}
} else {
showErrorDialog(context, "Aucune donnée geographique");
showAlertDialog(
context, "Erreur serveur", "Aucune donnée geographique");
}
} else {
showErrorDialog(context, "Mapbox non accessible");
showAlertDialog(context, "Erreur serveur", "Mapbox non accessible");
}
} catch (e) {
showErrorDialog(context, "${e}");
showAlertDialog(context, "Erreur serveur", "${e}");
}
} else {
showErrorDialog(context, "Champ vide");
showAlertDialog(context, "Erreur utilisateur", "Champ vide");
}
} else {
showErrorDialog(context, "Evenement non futur");
showAlertDialog(context, "Erreur evenement", "Evenement non futur");
}
}