Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 1 day ago
JSON representation

An example project of how to add an "auto expanding" navigation rail.

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)