Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luckey-elijah/auto_expanding_navigation_rail
An example project of how to add an "auto expanding" navigation rail.
https://github.com/luckey-elijah/auto_expanding_navigation_rail
Last synced: 10 days ago
JSON representation
An example project of how to add an "auto expanding" navigation rail.
- Host: GitHub
- URL: https://github.com/luckey-elijah/auto_expanding_navigation_rail
- Owner: Luckey-Elijah
- Created: 2022-07-29T19:25:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-02T15:46:57.000Z (over 2 years ago)
- Last Synced: 2025-01-27T17:57:59.596Z (16 days ago)
- Language: CMake
- Size: 5.3 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# auto_expanding_navigation_rail
An example project of how to add an "auto expanding" navigation rail.
## tldr;
Wrap a `NavigationRail` in a `MouseRegion`:
```dart
MouseRegion(
onEnter: (_) => setState(() => expanded = true),
onExit: (_) => setState(() => expanded = false),
child: NavigationRail(
destinations: [ ... ],
selectedIndex: index,
extended: expanded,
onDestinationSelected: (i) => setState(() => index = i),
),
)
```![](auto-nav-rail.mov.gif)