D1APP-16 bottom sheet size configured

This commit is contained in:
MohammadTaha Basiri 2022-01-05 19:41:17 +03:30
parent 1c0faf0db5
commit df40160c55
1 changed files with 49 additions and 44 deletions

View File

@ -58,6 +58,8 @@ class ActionSheetUtils {
static Future<void> showBottomSheet({required ActionSheetData data}) async { static Future<void> showBottomSheet({required ActionSheetData data}) async {
await showModalBottomSheet( await showModalBottomSheet(
backgroundColor: Colors.transparent,
isScrollControlled: true,
context: context, context: context,
builder: (context) => Container( builder: (context) => Container(
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
@ -69,57 +71,60 @@ class ActionSheetUtils {
), ),
), ),
), ),
child: Column( child: SingleChildScrollView(
mainAxisSize: MainAxisSize.min, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Center( children: [
child: Container( Center(
height: 3, child: Container(
width: 50, height: 3,
color: Theme.of(context).colorScheme.hint, width: 50,
color: Theme.of(context).colorScheme.hint,
),
), ),
), const SizedBox(height: 8),
const SizedBox(height: 8), Row(
Row( children: [
children: [ if (data.titleIcon != null)
if (data.titleIcon != null) Icon(
Icon( data.titleIcon,
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: color:
data.titleColor ?? Theme.of(context).colorScheme.title, data.titleColor ?? Theme.of(context).colorScheme.title,
), )
if (data.titleIcon != null) const SizedBox(width: 8), ],
DidvanText( ),
data.title, const SizedBox(height: 28),
style: Theme.of(context).textTheme.subtitle1, data.content,
color: data.titleColor ?? Theme.of(context).colorScheme.title, const SizedBox(height: 28),
) Row(
], children: [
), if (data.hasDismissButton)
const SizedBox(height: 28), Expanded(
data.content, child: DidvanButton(
const SizedBox(height: 28), title: data.dismissTitle ?? 'بازگشت',
Row( style: ButtonStyleMode.flat,
children: [ ),
if (data.hasDismissButton) ),
if (data.hasDismissButton) const SizedBox(width: 20),
Expanded( Expanded(
child: DidvanButton( child: DidvanButton(
title: data.dismissTitle ?? 'بازگشت', style: ButtonStyleMode.primary,
style: ButtonStyleMode.flat, onPressed: () {},
title: data.confrimTitle ?? 'تایید',
), ),
), ),
if (data.hasDismissButton) const SizedBox(width: 20), ],
Expanded( ),
child: DidvanButton( ],
style: ButtonStyleMode.primary, ),
onPressed: () {},
title: data.confrimTitle ?? 'تایید',
),
),
],
),
],
), ),
), ),
); );