Skip to content

Commit

Permalink
Change editPdf to false after a succesfull pdf change
Browse files Browse the repository at this point in the history
  • Loading branch information
Foukki committed Sep 18, 2024
1 parent bce5548 commit e34d67a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/ph/ui/pages/form_page/add_edit_ph_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class PhAddEditPhPage extends HookConsumerWidget {

final phListNotifier = ref.watch(phListProvider.notifier);
final phSendPdf = ref.watch(phSendPdfProvider);
final editPdfNotifier = ref.watch(editPdfProvider.notifier);
final editPdf = ref.watch(editPdfProvider);

void displayPhToastWithContext(TypeMsg type, String msg) {
Expand Down Expand Up @@ -117,12 +118,6 @@ class PhAddEditPhPage extends HookConsumerWidget {
.invokeMethod('TextInput.hide');
QR.back();
{
displayPhToastWithContext(
TypeMsg.msg,
isEdit
? PhTextConstants.edited
: PhTextConstants.added,
);
if (editPdf) {
phList.maybeWhen(
data: (list) {
Expand All @@ -138,6 +133,13 @@ class PhAddEditPhPage extends HookConsumerWidget {
orElse: () {},
);
}
displayPhToastWithContext(
TypeMsg.msg,
isEdit
? PhTextConstants.edited
: PhTextConstants.added,
);
editPdfNotifier.editPdf(false);
}
} else {
displayPhToastWithContext(
Expand Down

0 comments on commit e34d67a

Please sign in to comment.