TF-1915 Add await for all show dialog

(cherry picked from commit f710f75f3ffb29a4e2fabfc33054eaa4554a944c)
This commit is contained in:
dab246
2023-06-09 09:57:34 +07:00
committed by Dat Vu
parent 18df4672aa
commit 50635049ab
3 changed files with 7 additions and 7 deletions
@@ -49,8 +49,8 @@ class ConfirmationDialogActionSheetBuilder {
_styleCancelButton = style; _styleCancelButton = style;
} }
void show() { void show() async {
showCupertinoModalPopup( await showCupertinoModalPopup(
context: _context, context: _context,
barrierColor: AppColor.colorDefaultCupertinoActionSheet, barrierColor: AppColor.colorDefaultCupertinoActionSheet,
builder: (context) => PointerInterceptor(child: CupertinoActionSheet( builder: (context) => PointerInterceptor(child: CupertinoActionSheet(
@@ -163,7 +163,7 @@ class ToastView {
required double currentMaxWidth, required double currentMaxWidth,
Widget? leading Widget? leading
}) { }) {
return leading == null ? currentMaxWidth : currentMaxWidth - 90; return leading == null ? currentMaxWidth : currentMaxWidth - 100;
} }
static Positioned _showWidgetBasedOnPosition( static Positioned _showWidgetBasedOnPosition(
@@ -28,12 +28,12 @@ mixin MessageDialogActionMixin {
Color? actionButtonColor, Color? actionButtonColor,
Color? cancelButtonColor, Color? cancelButtonColor,
} }
) { ) async {
final responsiveUtils = Get.find<ResponsiveUtils>(); final responsiveUtils = Get.find<ResponsiveUtils>();
final imagePaths = Get.find<ImagePaths>(); final imagePaths = Get.find<ImagePaths>();
if (alignCenter) { if (alignCenter) {
showDialog( await showDialog(
context: context, context: context,
barrierColor: AppColor.colorDefaultCupertinoActionSheet, barrierColor: AppColor.colorDefaultCupertinoActionSheet,
builder: (BuildContext context) => PointerInterceptor( builder: (BuildContext context) => PointerInterceptor(
@@ -63,7 +63,7 @@ mixin MessageDialogActionMixin {
} else { } else {
if (responsiveUtils.isMobile(context)) { if (responsiveUtils.isMobile(context)) {
if (showAsBottomSheet) { if (showAsBottomSheet) {
showModalBottomSheet( await showModalBottomSheet(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
barrierColor: AppColor.colorDefaultCupertinoActionSheet, barrierColor: AppColor.colorDefaultCupertinoActionSheet,
@@ -107,7 +107,7 @@ mixin MessageDialogActionMixin {
})).show(); })).show();
} }
} else { } else {
showDialog( await showDialog(
context: context, context: context,
barrierColor: AppColor.colorDefaultCupertinoActionSheet, barrierColor: AppColor.colorDefaultCupertinoActionSheet,
builder: (BuildContext context) => PointerInterceptor( builder: (BuildContext context) => PointerInterceptor(