forked from mirrors/material_3_expressive
Add optional background color to NavigationRailM3E and bump package versions to 0.3.4
This commit is contained in:
parent
f135a6a5f7
commit
ac87434543
4 changed files with 12 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
name: m3e_collection
|
||||
description: Aggregated exports of all Material 3 Expressive components for Flutter.
|
||||
version: 0.3.3
|
||||
version: 0.3.4
|
||||
repository: https://github.com/EmilyMoonstone/material_3_expressive/tree/main/packages/m3e_collection
|
||||
issue_tracker: https://github.com/EmilyMonestone/material_3_expressive/issues
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ environment:
|
|||
sdk: ">=3.5.0 <4.0.0"
|
||||
|
||||
dependencies:
|
||||
app_bar_m3e: ^0.1.1
|
||||
app_bar_m3e: ^0.1.2
|
||||
button_group_m3e: ^0.1.1
|
||||
button_m3e: ^0.1.1
|
||||
expressive_refresh: ^0.1.2
|
||||
|
|
@ -20,7 +20,7 @@ dependencies:
|
|||
m3e_design: ^0.2.1
|
||||
material_new_shapes: ^1.0.0
|
||||
navigation_bar_m3e: ^0.1.1
|
||||
navigation_rail_m3e: ^0.3.3
|
||||
navigation_rail_m3e: ^0.3.4
|
||||
progress_indicator_m3e: ^0.1.1
|
||||
slider_m3e: ^0.1.1
|
||||
split_button_m3e: ^0.2.1
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class NavigationRailM3E extends StatefulWidget {
|
|||
this.scrollable = true,
|
||||
this.trailing,
|
||||
this.trailingAtBottom = true,
|
||||
this.background,
|
||||
});
|
||||
|
||||
/// Presentation type for the rail (collapsed or expanded or alwaysCollapsed or alwaysExpanded).
|
||||
|
|
@ -80,6 +81,10 @@ class NavigationRailM3E extends StatefulWidget {
|
|||
/// If false, [trailing] appears directly after the sections.
|
||||
final bool trailingAtBottom;
|
||||
|
||||
/// Optional background color for the rail. If null, falls back to
|
||||
/// [NavigationRailTokensAdapter.containerColor] from the current theme.
|
||||
final Color? background;
|
||||
|
||||
@override
|
||||
State<NavigationRailM3E> createState() => _NavigationRailM3EState();
|
||||
}
|
||||
|
|
@ -464,7 +469,8 @@ class _NavigationRailM3EState extends State<NavigationRailM3E>
|
|||
duration: const Duration(milliseconds: 280),
|
||||
curve: Curves.easeOutCubic,
|
||||
width: width,
|
||||
decoration: BoxDecoration(color: tokens.containerColor),
|
||||
decoration:
|
||||
BoxDecoration(color: widget.background ?? tokens.containerColor),
|
||||
child: LayoutBuilder(
|
||||
builder: (ctx, constraints) {
|
||||
final showLabels = _isExpanded && constraints.maxWidth >= 180;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ class NavigationRailTokensAdapter {
|
|||
/// Background color of the rail container.
|
||||
Color get containerColor {
|
||||
// Use surface container token if present, else fallback.
|
||||
return _maybe(() => context.m3e.colors.surfaceContainer) ??
|
||||
_cs.surfaceContainer;
|
||||
return _maybe(() => context.m3e.colors.surface) ?? _cs.surface;
|
||||
}
|
||||
|
||||
/// Background color of the active item indicator.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
name: navigation_rail_m3e
|
||||
description: Material 3 Expressive navigation rail (collapsed & expanded) with modal/standard modes, badges, sections, and m3e_design token integration.
|
||||
version: 0.3.3
|
||||
version: 0.3.4
|
||||
homepage: https://github.com/EmilyMonestone/material_3_expressive
|
||||
repository: https://github.com/EmilyMoonstone/material_3_expressive/tree/main/packages/navigation_rail_m3e
|
||||
issue_tracker: https://github.com/EmilyMonestone/material_3_expressive/issues
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue