Skip to content

Commit 1115def

Browse files
authored
fix/403 (#404)
1 parent 1168293 commit 1115def

File tree

4 files changed

+44
-37
lines changed

4 files changed

+44
-37
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.28.2
2+
3+
- **FIX**: `ShadDialog` and `ShadSheet` now use `SafeArea` to prevent the content from being cut off by the system UI.
4+
15
## 0.28.1
26

37
- **FIX**: Add `clearValueOnUnregister` to `ShadForm` (defaults to `false`) to prevent clearing a form field's value from the form state when the field is unregistered (aka disposed).

example/lib/pages/sheet.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class _SheetPageState extends State<SheetPage> {
5454
builder: (context) {
5555
return ShadSheet(
5656
draggable: draggable,
57-
constraints:
58-
side == ShadSheetSide.left || side == ShadSheetSide.right
59-
? const BoxConstraints(maxWidth: 512)
60-
: null,
57+
constraints: side == ShadSheetSide.left ||
58+
side == ShadSheetSide.right
59+
? const BoxConstraints(maxWidth: 512)
60+
: null,
6161
title: const Text('Edit Profile'),
6262
description: const Text(
6363
"Make changes to your profile here. Click save when you're done"),

lib/src/components/dialog.dart

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -572,41 +572,44 @@ class ShadDialog extends StatelessWidget {
572572
border: effectiveBorder,
573573
boxShadow: effectiveShadows,
574574
),
575-
child: Stack(
576-
children: [
577-
Padding(
578-
padding: effectivePadding,
579-
child: Column(
580-
mainAxisSize: MainAxisSize.min,
581-
mainAxisAlignment: effectiveMainAxisAlignment,
582-
crossAxisAlignment: effectiveCrossAxisAlignment,
583-
children: [
584-
if (title != null)
585-
DefaultTextStyle(
586-
style: effectiveTitleStyle,
587-
textAlign: effectiveTitleTextAlign,
588-
child: title!,
589-
),
590-
if (description != null)
591-
DefaultTextStyle(
592-
style: effectiveDescriptionStyle,
593-
textAlign: effectiveDescriptionTextAlign,
594-
child: description!,
595-
),
596-
if (child != null)
597-
Flexible(
598-
child: DefaultTextStyle(
575+
child: SafeArea(
576+
child: Stack(
577+
children: [
578+
Padding(
579+
padding: effectivePadding,
580+
child: Column(
581+
mainAxisSize: MainAxisSize.min,
582+
mainAxisAlignment: effectiveMainAxisAlignment,
583+
crossAxisAlignment: effectiveCrossAxisAlignment,
584+
children: [
585+
if (title != null)
586+
DefaultTextStyle(
587+
style: effectiveTitleStyle,
588+
textAlign: effectiveTitleTextAlign,
589+
child: title!,
590+
),
591+
if (description != null)
592+
DefaultTextStyle(
599593
style: effectiveDescriptionStyle,
600-
child: child!,
594+
textAlign: effectiveDescriptionTextAlign,
595+
child: description!,
596+
),
597+
if (child != null)
598+
Flexible(
599+
child: DefaultTextStyle(
600+
style: effectiveDescriptionStyle,
601+
child: child!,
602+
),
601603
),
602-
),
603-
if (actions.isNotEmpty) effectiveActions,
604-
].separatedBy(SizedBox(height: effectiveGap)),
604+
if (actions.isNotEmpty) effectiveActions,
605+
].separatedBy(SizedBox(height: effectiveGap)),
606+
),
605607
),
606-
),
607-
if (effectiveCloseIcon != null)
608-
effectiveCloseIcon.positionedWith(effectiveCloseIconPosition),
609-
],
608+
if (effectiveCloseIcon != null)
609+
effectiveCloseIcon
610+
.positionedWith(effectiveCloseIconPosition),
611+
],
612+
),
610613
),
611614
);
612615
},

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: shadcn_ui
22
description: shadcn/ui ported in Flutter. Awesome UI components for Flutter, fully customizable.
3-
version: 0.28.1
3+
version: 0.28.2
44
homepage: https://flutter-shadcn-ui.mariuti.com
55
repository: https://github.com/nank1ro/flutter-shadcn-ui
66
documentation: https://flutter-shadcn-ui.mariuti.com

0 commit comments

Comments
 (0)