Skip to content

Commit

Permalink
feat(#718): make dialog fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Sep 2, 2024
1 parent 21dcdea commit f4efef1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 24 deletions.
70 changes: 46 additions & 24 deletions app/lib/common/widgets/tutorial/tutorial_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@ class TutorialBuilder extends HookWidget {
? currentPage.content!(context)
: null;
final imageAsset = currentPage.assetPath != null
? Image.asset(currentPage.assetPath!)
? Container(
color: PharMeTheme.onSurfaceColor,
child: Center(child: Image.asset(currentPage.assetPath!)),
)
: null;
final titleStyle = PharMeTheme.textTheme.headlineMedium!.copyWith(
fontSize: PharMeTheme.textTheme.headlineSmall!.fontSize,
);
final assetContainer = imageAsset != null
? Stack(
children: [
Container(
color: PharMeTheme.onSurfaceColor,
child: Center(child: imageAsset),
),
imageAsset,
Positioned(
top: PharMeTheme.smallSpace,
right: PharMeTheme.smallSpace,
Expand All @@ -58,30 +61,51 @@ class TutorialBuilder extends HookWidget {
),
color: PharMeTheme.onSurfaceColor,
onPressed: () async => {
await showAdaptiveDialog(
await showDialog(
// ignore: use_build_context_synchronously
context: context,
builder: (context) => AlertDialog.adaptive(
content: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
builder: (context) => Dialog.fullscreen(
backgroundColor: Colors.transparent,
child: SafeArea(
child: RoundedCard(
outerHorizontalPadding: 0,
outerVerticalPadding: 0,
innerPadding: EdgeInsets.all(PharMeTheme.largeSpace),
child: Column(
children: [
GestureDetector(
onTap: () => Navigator.pop(context),
child: Icon(
Icons.close,
color: PharMeTheme.onSurfaceText,
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (title != null) Expanded(
child: FittedBox(
fit: BoxFit.fitWidth,
child: Text(
title,
style: titleStyle,
),
),
),
SizedBox(width: PharMeTheme.smallSpace),
GestureDetector(
onTap: () => Navigator.pop(context),
child: Icon(
Icons.close,
color: PharMeTheme.onSurfaceText,
),
),
],
),
SizedBox(height: PharMeTheme.smallToMediumSpace),
Expanded(
child: imageAsset,
),
],
),
SizedBox(height: PharMeTheme.smallToMediumSpace),
imageAsset,
],
),
),
),
)
),
},
icon: Icon(Icons.zoom_in),
),
Expand All @@ -92,9 +116,7 @@ class TutorialBuilder extends HookWidget {
return [
if (title != null) Text(
title,
style: PharMeTheme.textTheme.headlineMedium!.copyWith(
fontSize: PharMeTheme.textTheme.headlineSmall!.fontSize,
),
style: titleStyle,
),
if (content != null) Padding(
padding: EdgeInsetsDirectional.only(top: PharMeTheme.mediumSpace),
Expand Down
1 change: 1 addition & 0 deletions pharme.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"drugrecommendation",
"duloxetine",
"fluorouracil",
"fullscreen",
"haplotype",
"haplotypes",
"Hasso",
Expand Down

0 comments on commit f4efef1

Please sign in to comment.