The default behavior for Get.defaultDialog's onCancel method should be closeAllDialogs();
Showing
1 changed file
with
5 additions
and
2 deletions
@@ -196,8 +196,11 @@ extension ExtensionDialog on GetInterface { | @@ -196,8 +196,11 @@ extension ExtensionDialog on GetInterface { | ||
196 | borderRadius: BorderRadius.circular(radius)), | 196 | borderRadius: BorderRadius.circular(radius)), |
197 | ), | 197 | ), |
198 | onPressed: () { | 198 | onPressed: () { |
199 | - onCancel?.call(); | ||
200 | - back(); | 199 | + if (onCancel == null) { |
200 | + closeAllDialogs(); | ||
201 | + } else { | ||
202 | + onCancel.call(); | ||
203 | + } | ||
201 | }, | 204 | }, |
202 | child: Text( | 205 | child: Text( |
203 | textCancel ?? "Cancel", | 206 | textCancel ?? "Cancel", |
-
Please register or login to post a comment