forked from mirrors/material_3_expressive
Remove unused dynamic field lookup and redundant utility methods; clean up pubspec dependency paths and update READMEs with detailed package guides.
This commit is contained in:
parent
80a27714a6
commit
401dd103a6
30 changed files with 799 additions and 64 deletions
|
|
@ -66,3 +66,64 @@ flutter run -d chrome
|
|||
```
|
||||
|
||||
_Last updated: 2025-10-23_
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Detailed Guide
|
||||
|
||||
### What this package provides
|
||||
NavigationRailM3E with collapsed/expanded states, standard/modal presentation, badges, sections, and slots for FAB/menu. Integrates tightly with M3E tokens.
|
||||
|
||||
### Installation
|
||||
- Monorepo (local path): already configured alongside m3e_design, fab_m3e, icon_button_m3e, button_m3e.
|
||||
- Pub (when published):
|
||||
```yaml
|
||||
dependencies:
|
||||
navigation_rail_m3e: ^0.1.0
|
||||
m3e_design: ^0.1.0
|
||||
fab_m3e: ^0.1.0
|
||||
icon_button_m3e: ^0.1.1
|
||||
button_m3e: ^0.1.0
|
||||
```
|
||||
|
||||
Minimum SDK: Dart >=3.0.0.
|
||||
|
||||
### Dependencies
|
||||
- flutter
|
||||
- m3e_design, fab_m3e, icon_button_m3e, button_m3e
|
||||
|
||||
### Quick start
|
||||
```dart
|
||||
NavigationRailM3E(
|
||||
selectedIndex: 0,
|
||||
onDestinationSelected: (i) {},
|
||||
expanded: true,
|
||||
modal: false,
|
||||
leading: const FabM3E(icon: Icon(Icons.add)),
|
||||
destinations: const [
|
||||
NavigationRailDestinationM3E(icon: Icon(Icons.inbox), label: 'Inbox'),
|
||||
NavigationRailDestinationM3E(icon: Icon(Icons.send), label: 'Sent'),
|
||||
],
|
||||
)
|
||||
```
|
||||
|
||||
### Key parameters
|
||||
- expanded: bool — Expanded vs collapsed rail.
|
||||
- modal: bool — Modal overlay vs standard inline rail.
|
||||
- destinations: List<NavigationRailDestinationM3E> — Items to render.
|
||||
- selectedIndex: int; onDestinationSelected: ValueChanged<int> — Selection handling.
|
||||
- leading / trailing: Widget? — Header/footer area.
|
||||
- fab / menu slots: Widgets for actions and menus.
|
||||
- badgeBuilder / badgeCount: Optional per-item badges.
|
||||
|
||||
### Theming with m3e_design
|
||||
Rail colors, indicator style, and typography adapt from M3ETheme.
|
||||
|
||||
### Accessibility
|
||||
- Keyboard navigation, focus order, and semantics supported.
|
||||
|
||||
### Links
|
||||
- Repository: https://github.com/EmilyMoonstone/material_3_expressive/tree/main/packages/navigation_rail_m3e
|
||||
- Issue tracker: https://github.com/EmilyMonestone/material_3_expressive/issues
|
||||
- Changelog: ./CHANGELOG.md
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ class RailItem extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context).extension<NavigationRailM3ETheme>() ??
|
||||
const NavigationRailM3ETheme();
|
||||
final tokens = NavigationRailTokensAdapter(context);
|
||||
final height = destination.short ? theme.itemShortHeight : theme.itemHeight;
|
||||
|
||||
final Widget button = RailItemButtonM3E(
|
||||
|
|
|
|||
|
|
@ -11,18 +11,11 @@ environment:
|
|||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
# Integrates with your design system tokens.
|
||||
m3e_design:
|
||||
path: ../m3e_design
|
||||
# FAB components used by the rail (FabM3E and ExtendedFabM3E).
|
||||
fab_m3e:
|
||||
path: ../fab_m3e
|
||||
# Icon button used by the rail's menu control.
|
||||
icon_button_m3e:
|
||||
path: ../icon_button_m3e
|
||||
# Buttons used by rail items in expanded state.
|
||||
button_m3e:
|
||||
path: ../button_m3e
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue