Success dialog and Failed dialog changes with VisitorPasswordDialog

This commit is contained in:
mohammad
2024-08-23 22:25:09 +03:00
parent cf1a21e121
commit 820da1ecfb

View File

@ -246,12 +246,18 @@ class VisitorPasswordBloc
passwordName: event.passwordName);
if (res == true) {
emit(SuccessState());
emit(TableLoaded(data));
}else {
throw Exception('Failed to create password');
}
emit(TableLoaded(data));
} catch (e) {
emit(FailedState(e.toString()));
}
Navigator.pop(event.context!);
stateDialog(
context: event.context!,
message: e.toString(),
title: 'Something Wrong'); }
}
//offline password
@ -266,10 +272,18 @@ class VisitorPasswordBloc
passwordName: event.passwordName);
if (res == true) {
emit(SuccessState());
emit(TableLoaded(data));
}else {
throw Exception('Failed to create password');
}
emit(TableLoaded(data));
} catch (e) {
emit(FailedState(e.toString()));
Navigator.pop(event.context!);
stateDialog(
context: event.context!,
message: e.toString(),
title: 'Something Wrong');
}
}
@ -288,11 +302,18 @@ class VisitorPasswordBloc
);
if (res == true) {
emit(SuccessState());
emit(TableLoaded(data));
}else {
throw Exception('Failed to create password');
}
emit(TableLoaded(data));
} catch (e) {
emit(FailedState(e.toString()));
}
Navigator.pop(event.context!);
stateDialog(
context: event.context!,
message: e.toString(),
title: 'Something Wrong'); }
}
void selectDevice(