diff --git a/lib/models/view/action_sheet_data.dart b/lib/models/view/action_sheet_data.dart index 59992e8..3659dd8 100644 --- a/lib/models/view/action_sheet_data.dart +++ b/lib/models/view/action_sheet_data.dart @@ -10,6 +10,7 @@ class ActionSheetData { final IconData? titleIcon; final Color? titleColor; final bool hasDismissButton; + final bool withoutButtonMode; final bool smallDismissButton; ActionSheetData({ @@ -23,5 +24,6 @@ class ActionSheetData { this.dismissTitle, this.onDismissed, this.smallDismissButton = false, + this.withoutButtonMode = false, }); } diff --git a/lib/utils/action_sheet.dart b/lib/utils/action_sheet.dart index 212570b..18b4930 100644 --- a/lib/utils/action_sheet.dart +++ b/lib/utils/action_sheet.dart @@ -18,15 +18,11 @@ class ActionSheetUtils { static Future showLogoLoadingIndicator() async { await showDialog( context: context, - builder: (context) => - // _customSystemOverlayStyle( - // child: - Padding( + builder: (context) => Padding( padding: EdgeInsets.symmetric( horizontal: MediaQuery.of(context).size.width / 3, ), child: RiveAnimation.asset(Assets.logoLoadingAnimation), - // ), ), ); } @@ -75,45 +71,6 @@ class ActionSheetUtils { }, ), ); - // ignore: avoid_single_cascade_in_expression_statements - // Flushbar( - // margin: const EdgeInsets.only(left: 16, right: 16, bottom: 16), - // borderColor: foregroundColor, - // backgroundColor: backgroundColor, - // borderRadius: DesignConfig.mediumBorderRadius, - // padding: const EdgeInsets.symmetric(vertical: 16), - // icon: Icon( - // DidvanIcons.info_circle_solid, - // color: foregroundColor, - // ), - // shouldIconPulse: true, - // dismissDirection: FlushbarDismissDirection.HORIZONTAL, - // flushbarPosition: FlushbarPosition.BOTTOM, - // messageText: StatefulBuilder(builder: (context, setState) { - // if (isInit) { - // Future.delayed(Duration.zero, () { - // setState(() {}); - // isInit = false; - // }); - // } - // return Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // DidvanText(alertData.message, color: foregroundColor), - // AnimatedContainer( - // duration: const Duration(seconds: 2), - // width: isInit ? MediaQuery.of(context).size.width - 32 : 0, - // height: 2, - // color: foregroundColor, - // ), - // ], - // ); - // }), - // duration: const Duration(seconds: 2), - // boxShadows: [ - // BoxShadow(color: Theme.of(context).colorScheme.cardBorder), - // ], - // )..show(context); } static Future showBottomSheet({required ActionSheetData data}) async { @@ -164,33 +121,34 @@ class ActionSheetUtils { const SizedBox(height: 28), data.content, const SizedBox(height: 28), - Row( - children: [ - if (data.hasDismissButton) + if (!data.withoutButtonMode) + Row( + children: [ + if (data.hasDismissButton) + Expanded( + child: DidvanButton( + onPressed: () { + Navigator.of(context).pop(); + data.onDismissed?.call(); + }, + title: data.dismissTitle ?? 'بازگشت', + style: ButtonStyleMode.secondary, + ), + ), + if (data.hasDismissButton) const SizedBox(width: 20), Expanded( + flex: data.smallDismissButton ? 2 : 1, child: DidvanButton( + style: ButtonStyleMode.primary, onPressed: () { Navigator.of(context).pop(); - data.onDismissed?.call(); + data.onConfirmed?.call(); }, - title: data.dismissTitle ?? 'بازگشت', - style: ButtonStyleMode.secondary, + title: data.confrimTitle ?? 'تایید', ), ), - if (data.hasDismissButton) const SizedBox(width: 20), - Expanded( - flex: data.smallDismissButton ? 2 : 1, - child: DidvanButton( - style: ButtonStyleMode.primary, - onPressed: () { - Navigator.of(context).pop(); - data.onConfirmed?.call(); - }, - title: data.confrimTitle ?? 'تایید', - ), - ), - ], - ), + ], + ), ], ), ),