Fix can not show saving dialog anymore when click on back system button

This commit is contained in:
dab246
2024-05-02 02:33:13 +07:00
committed by Dat H. Pham
parent 9b4fbaf3d6
commit 0d8ce9eb8a
2 changed files with 119 additions and 99 deletions
@@ -1923,6 +1923,7 @@ class ComposerController extends BaseController with DragDropFileMixin {
alignCenter: true,
outsideDismissible: false,
autoPerformPopBack: false,
usePopScope: true,
onConfirmAction: () => _handleSaveMessageToDraft(context),
onCancelAction: () {
_closeComposerButtonState = ButtonState.enabled;
@@ -1933,6 +1934,14 @@ class ComposerController extends BaseController with DragDropFileMixin {
popBack();
_autoFocusFieldWhenLauncher();
},
onPopInvoked: (didPop) {
log('ComposerController::_showConfirmDialogSaveMessage: didPop = $didPop');
if (!didPop) {
_closeComposerButtonState = ButtonState.enabled;
popBack();
_autoFocusFieldWhenLauncher();
}
},
marginIcon: EdgeInsets.zero,
icon: SvgPicture.asset(
imagePaths.icQuotasWarning,