@@ -28,6 +28,9 @@ const double kMaterialMediumAndUpMargin = 24;
28
28
/// design 3 spec.
29
29
const double kMaterialPadding = 4 ;
30
30
31
+ /// Padding value of the default padding for the navigation rail
32
+ const double kNavigationRailDefaultPadding = 8 ;
33
+
31
34
/// Signature for a builder used by [AdaptiveScaffold.navigationRailDestinationBuilder] that converts a
32
35
/// [NavigationDestination] to a [NavigationRailDestination] .
33
36
typedef NavigationRailDestinationBuilder = NavigationRailDestination Function (
@@ -94,6 +97,8 @@ class AdaptiveScaffold extends StatefulWidget {
94
97
this .leadingUnextendedNavRail,
95
98
this .leadingExtendedNavRail,
96
99
this .trailingNavRail,
100
+ this .navigationRailPadding =
101
+ const EdgeInsets .all (kNavigationRailDefaultPadding),
97
102
this .smallBody,
98
103
this .body,
99
104
this .mediumLargeBody,
@@ -148,6 +153,9 @@ class AdaptiveScaffold extends StatefulWidget {
148
153
/// navigation rail at the largest breakpoint.
149
154
final Widget ? trailingNavRail;
150
155
156
+ /// Option to apply custom padding to the navigation rail.
157
+ final EdgeInsetsGeometry navigationRailPadding;
158
+
151
159
/// The alignment of the destinations in the navigation rail.
152
160
final double ? groupAlignment;
153
161
@@ -343,7 +351,8 @@ class AdaptiveScaffold extends StatefulWidget {
343
351
int ? selectedIndex,
344
352
bool extended = false ,
345
353
Color ? backgroundColor,
346
- EdgeInsetsGeometry padding = const EdgeInsets .all (8.0 ),
354
+ EdgeInsetsGeometry padding =
355
+ const EdgeInsets .all (kNavigationRailDefaultPadding),
347
356
Widget ? leading,
348
357
Widget ? trailing,
349
358
void Function (int )? onDestinationSelected,
@@ -608,6 +617,7 @@ class _AdaptiveScaffoldState extends State<AdaptiveScaffold> {
608
617
width: widget.navigationRailWidth,
609
618
leading: widget.leadingUnextendedNavRail,
610
619
trailing: widget.trailingNavRail,
620
+ padding: widget.navigationRailPadding,
611
621
selectedIndex: widget.selectedIndex,
612
622
destinations: destinations,
613
623
onDestinationSelected: widget.onSelectedIndexChange,
@@ -627,6 +637,7 @@ class _AdaptiveScaffoldState extends State<AdaptiveScaffold> {
627
637
extended: true ,
628
638
leading: widget.leadingExtendedNavRail,
629
639
trailing: widget.trailingNavRail,
640
+ padding: widget.navigationRailPadding,
630
641
selectedIndex: widget.selectedIndex,
631
642
destinations: destinations,
632
643
onDestinationSelected: widget.onSelectedIndexChange,
@@ -646,6 +657,7 @@ class _AdaptiveScaffoldState extends State<AdaptiveScaffold> {
646
657
extended: true ,
647
658
leading: widget.leadingExtendedNavRail,
648
659
trailing: widget.trailingNavRail,
660
+ padding: widget.navigationRailPadding,
649
661
selectedIndex: widget.selectedIndex,
650
662
destinations: widget.destinations
651
663
.map ((NavigationDestination destination) =>
@@ -666,6 +678,7 @@ class _AdaptiveScaffoldState extends State<AdaptiveScaffold> {
666
678
extended: true ,
667
679
leading: widget.leadingExtendedNavRail,
668
680
trailing: widget.trailingNavRail,
681
+ padding: widget.navigationRailPadding,
669
682
selectedIndex: widget.selectedIndex,
670
683
destinations: widget.destinations
671
684
.map ((NavigationDestination destination) =>
0 commit comments