Skip to content

Commit

Permalink
Merge pull request #3011 from leeyisoft/master
Browse files Browse the repository at this point in the history
The default behavior for Get.defaultDialog's onCancel method should be closeAllDialogs();
  • Loading branch information
jonataslaw committed Feb 17, 2024
2 parents 499b4a2 + 2f50a80 commit 3de0bd3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/get_navigation/src/extension_navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ extension ExtensionDialog on GetInterface {
borderRadius: BorderRadius.circular(radius)),
),
onPressed: () {
onCancel?.call();
back();
if (onCancel == null) {
//TODO: Close current dialog after api change
closeAllDialogs();
} else {
onCancel.call();
}
},
child: Text(
textCancel ?? "Cancel",
Expand Down

0 comments on commit 3de0bd3

Please sign in to comment.