Skip to content

Commit 4648244

Browse files
feat(cat-voices): enhance dialog positioning with fillPosition parameter (#2157) (#2158)
* feat: add fillPosition option to dialog classes * feat: update SubmitCommentErrorDialog for fillPosition support * feat: conditionally render child in VoicesSinglePaneDialog based on fillPosition * feat: pass fillPosition to VoicesDesktopInfoDialog Co-authored-by: Damian Moliński <[email protected]>
1 parent b826495 commit 4648244

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

catalyst_voices/apps/voices/lib/widgets/modals/comment/submit_comment_error_dialog.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class SubmitCommentErrorDialog {
2020
),
2121
builder: (context) {
2222
return VoicesDesktopInfoDialog(
23+
fillPosition: true,
2324
icon: VoicesAssets.icons.exclamation.buildIcon(
2425
color: Theme.of(context).colors.iconsWarning,
2526
),

catalyst_voices/apps/voices/lib/widgets/modals/voices_desktop_dialog.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class VoicesSinglePaneDialog extends StatelessWidget {
1515
final bool showClose;
1616
final Alignment closeAlignment;
1717
final Widget child;
18+
final bool fillPosition;
1819

1920
const VoicesSinglePaneDialog({
2021
super.key,
@@ -27,6 +28,7 @@ class VoicesSinglePaneDialog extends StatelessWidget {
2728
this.showBorder = false,
2829
this.showClose = true,
2930
this.closeAlignment = Alignment.topRight,
31+
this.fillPosition = false,
3032
required this.child,
3133
});
3234

@@ -39,7 +41,12 @@ class VoicesSinglePaneDialog extends StatelessWidget {
3941
child: Stack(
4042
alignment: closeAlignment,
4143
children: [
42-
Positioned.fill(child: child),
44+
if (fillPosition)
45+
Positioned.fill(
46+
child: child,
47+
)
48+
else
49+
child,
4350
Offstage(
4451
offstage: !showClose,
4552
child: const _CloseButton(),

catalyst_voices/apps/voices/lib/widgets/modals/voices_info_dialog.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ class VoicesDesktopInfoDialog extends StatelessWidget {
1515
final Widget title;
1616
final Widget message;
1717
final Widget action;
18+
final bool fillPosition;
1819

1920
const VoicesDesktopInfoDialog({
2021
super.key,
2122
required this.icon,
2223
required this.title,
2324
required this.message,
2425
required this.action,
26+
this.fillPosition = false,
2527
});
2628

2729
@override
@@ -45,6 +47,7 @@ class VoicesDesktopInfoDialog extends StatelessWidget {
4547
);
4648

4749
return VoicesSinglePaneDialog(
50+
fillPosition: fillPosition,
4851
child: Padding(
4952
padding: const EdgeInsets.symmetric(horizontal: 83),
5053
child: Column(

0 commit comments

Comments
 (0)