Skip to content

Commit 4600131

Browse files
committed
change dropdown padding & margin
1 parent 280f8c0 commit 4600131

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [4.8.0]
2+
* change dropdown padding => margin
3+
* add dropdown padding
4+
15
## [4.7.5]
26
* fix dropdown offset
37

lib/src/my_dialog.dart

+3
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ class MyDialog {
330330
HitTestBehavior? backdropBehavior,
331331
Color? backdropColor,
332332
EdgeInsets? padding,
333+
EdgeInsets? margin,
333334
Set<DropDownLayoutPosition>? position,
334335
AnimationConfig? animate,
335336
AnimationConfig? leaveAnimate,
@@ -845,6 +846,7 @@ class ShirneDialog {
845846
HitTestBehavior? backdropBehavior,
846847
Color? backdropColor,
847848
EdgeInsets? padding,
849+
EdgeInsets? margin,
848850
Set<DropDownLayoutPosition>? position,
849851
AnimationConfig? animate,
850852
AnimationConfig? leaveAnimate,
@@ -862,6 +864,7 @@ class ShirneDialog {
862864
actions: actions,
863865
origRect: origRect,
864866
padding: padding ?? const EdgeInsets.all(8),
867+
margin: margin ?? const EdgeInsets.all(8),
865868
position: position,
866869
actionAlignment: actionAlignment,
867870
elevation: elevation ?? 4.0,

lib/src/widgets/dropdown.dart

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class DropdownWidget extends StatefulWidget {
99
required this.origRect,
1010
required this.actions,
1111
this.actionAlignment,
12-
this.padding = EdgeInsets.zero,
12+
this.padding = const EdgeInsets.all(8),
13+
this.margin = EdgeInsets.zero,
1314
this.position,
1415
this.elevation = 3.0,
1516
this.animate,
@@ -21,6 +22,7 @@ class DropdownWidget extends StatefulWidget {
2122
final List<Widget> actions;
2223
final CrossAxisAlignment? actionAlignment;
2324
final EdgeInsets padding;
25+
final EdgeInsets margin;
2426
final Set<DropDownLayoutPosition>? position;
2527
final AnimationConfig? animate;
2628
final AnimationConfig? leaveAnimate;
@@ -41,7 +43,7 @@ class _DropdownWidgetState extends State<DropdownWidget> {
4143
return CustomSingleChildLayout(
4244
delegate: _DropDownLayout(
4345
origRect: widget.origRect,
44-
padding: widget.padding,
46+
padding: widget.margin,
4547
position: widget.position,
4648
cornerHeight: triangle.height,
4749
layoutPositionNotifier: layoutPositionNotifier,
@@ -69,7 +71,7 @@ class _DropdownWidgetState extends State<DropdownWidget> {
6971
cornerPosition: layoutPositionNotifier,
7072
),
7173
child: Container(
72-
padding: const EdgeInsets.all(8),
74+
padding: widget.padding,
7375
constraints: BoxConstraints(minWidth: widget.origRect.width),
7476
child: Column(
7577
mainAxisSize: MainAxisSize.min,

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: shirne_dialog
22
description: A flutter package to use alert, toast, popup, snack, imagePreview, loading etc. with customizable style in anywhere.
3-
version: 4.7.5
3+
version: 4.8.0
44
homepage: https://shirne.github.io/dialog/
55
repository: https://github.com/shirne/shirne_dialog
66
screenshots:

0 commit comments

Comments
 (0)