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 {
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 ?? 'تایید',
),
),
],
),
],
],
),
],
),
),
),
);