From df40160c55d7556d3884b36e6e9db8f8a1857b4f Mon Sep 17 00:00:00 2001 From: MohammadTaha Basiri Date: Wed, 5 Jan 2022 19:41:17 +0330 Subject: [PATCH] D1APP-16 bottom sheet size configured --- lib/utils/action_sheet.dart | 93 +++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/lib/utils/action_sheet.dart b/lib/utils/action_sheet.dart index 380f471..a44f4a0 100644 --- a/lib/utils/action_sheet.dart +++ b/lib/utils/action_sheet.dart @@ -58,6 +58,8 @@ class ActionSheetUtils { static Future showBottomSheet({required ActionSheetData data}) async { await showModalBottomSheet( + backgroundColor: Colors.transparent, + isScrollControlled: true, context: context, builder: (context) => Container( padding: const EdgeInsets.all(20), @@ -69,57 +71,60 @@ class ActionSheetUtils { ), ), ), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Center( - child: Container( - height: 3, - width: 50, - color: Theme.of(context).colorScheme.hint, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Container( + height: 3, + width: 50, + color: Theme.of(context).colorScheme.hint, + ), ), - ), - const SizedBox(height: 8), - Row( - children: [ - if (data.titleIcon != null) - Icon( - data.titleIcon, + const SizedBox(height: 8), + Row( + children: [ + if (data.titleIcon != null) + Icon( + data.titleIcon, + color: data.titleColor ?? + Theme.of(context).colorScheme.title, + ), + if (data.titleIcon != null) const SizedBox(width: 8), + DidvanText( + data.title, + style: Theme.of(context).textTheme.subtitle1, color: data.titleColor ?? Theme.of(context).colorScheme.title, - ), - if (data.titleIcon != null) const SizedBox(width: 8), - DidvanText( - data.title, - style: Theme.of(context).textTheme.subtitle1, - color: data.titleColor ?? Theme.of(context).colorScheme.title, - ) - ], - ), - const SizedBox(height: 28), - data.content, - const SizedBox(height: 28), - Row( - children: [ - if (data.hasDismissButton) + ) + ], + ), + const SizedBox(height: 28), + data.content, + const SizedBox(height: 28), + Row( + children: [ + if (data.hasDismissButton) + Expanded( + child: DidvanButton( + title: data.dismissTitle ?? 'بازگشت', + style: ButtonStyleMode.flat, + ), + ), + if (data.hasDismissButton) const SizedBox(width: 20), Expanded( child: DidvanButton( - title: data.dismissTitle ?? 'بازگشت', - style: ButtonStyleMode.flat, + style: ButtonStyleMode.primary, + onPressed: () {}, + title: data.confrimTitle ?? 'تایید', ), ), - if (data.hasDismissButton) const SizedBox(width: 20), - Expanded( - child: DidvanButton( - style: ButtonStyleMode.primary, - onPressed: () {}, - title: data.confrimTitle ?? 'تایید', - ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), );