Skip to content

Commit

Permalink
feat: add configurable padding and navBarHeight in modal
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasn committed Feb 8, 2025
1 parent 232deaf commit 1d2a0df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class EntryDatetimeWidget extends ConsumerWidget {
builder: (BuildContext _) {
return EntryDateTimeModal(item: entry);
},
navBarHeight: 20,
);
},
child: Padding(
Expand Down
6 changes: 6 additions & 0 deletions lib/utils/modals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ class ModalUtils {
bool isTopBarLayerAlwaysVisible = true,
bool showCloseButton = true,
EdgeInsetsGeometry padding = WoltModalConfig.pagePadding,
double? navBarHeight,
}) {
final textTheme = context.textTheme;
return WoltModalSheetPage(
backgroundColor: context.colorScheme.surfaceContainerHigh,
hasSabGradient: false,
navBarHeight: navBarHeight,
topBarTitle:
title != null ? Text(title, style: textTheme.titleSmall) : null,
isTopBarLayerAlwaysVisible: isTopBarLayerAlwaysVisible,
Expand All @@ -50,6 +52,8 @@ class ModalUtils {
required Widget Function(BuildContext) builder,
String? title,
Widget Function(Widget)? modalDecorator,
EdgeInsetsGeometry padding = WoltModalConfig.pagePadding,
double? navBarHeight,
}) async {
return WoltModalSheet.show<T>(
context: context,
Expand All @@ -61,6 +65,8 @@ class ModalUtils {
child: builder(modalSheetContext),
isTopBarLayerAlwaysVisible: title != null,
showCloseButton: title != null,
padding: padding,
navBarHeight: navBarHeight,
),
];
},
Expand Down

0 comments on commit 1d2a0df

Please sign in to comment.