nova_drawer 1.2.2
nova_drawer: ^1.2.2 copied to clipboard
NovaDrawer – Production-grade Flutter drawer system with responsive layout
Changelog #
1.2.2 #
- Auto scroll bug fix
1.2.1 #
- Bug fixes
1.2.0 #
New Features #
-
Auto-scroll to selected item (
NovaDrawerConfig.enableAutoScrollToSelected): When the drawer opens, it now automatically animates the scroll position so that the currently selected item is centred in the visible area. This is especially valuable when there are many items (30+) and the user last tapped one near the bottom or top.The feature is enabled by default and can be tuned or disabled:
NovaDrawerConfig( enableAutoScrollToSelected: true, // default autoScrollDuration: Duration(milliseconds: 380), autoScrollCurve: Curves.easeInOut, )Works with all three item layouts (flat
items,sections, andentries). -
Footer variant system — 5 modern, fully flexible footers: A new
NovaDrawerFooterwidget (parallel toNovaDrawerHeader) routes to one of five built-in footer variants based onNovaFooterConfig.variant:Variant Description NovaFooterVariant.minimalVersion text + optional quick-links and legal text NovaFooterVariant.brandingLogo widget + app name + version + accent line NovaFooterVariant.actionsCentred row of labelled icon buttons (notifications, settings, logout…) NovaFooterVariant.userCardCompact avatar + name + email + settings/logout icons NovaFooterVariant.upgradeAnimated gradient upgrade / premium CTA banner Drop any variant into
NovaAppDrawer.footer:NovaAppDrawer( footer: NovaDrawerFooter( config: NovaFooterConfig( variant: NovaFooterVariant.userCard, profile: NovaHeaderUserProfile(name: 'Alice', email: 'alice@acme.com'), onSettingsTap: () => Navigator.pushNamed(context, '/settings'), onLogoutTap: () => authService.logout(), ), ), ... )A custom builder is also supported via
NovaFooterConfig.customFooterBuilder. -
5 new header variants — brings the total to 15 built-in header styles:
Variant NovaHeaderVariantvalueDescription Neumorphic neumorphicSoft-UI embossed shadows on a neutral surface Banner Info bannerInfoGradient banner with scrollable stat chips from metadataMinimal Card minimalCardElevated rounded card with compact info row Dark Glass darkGlassDeep blur dark panel with a neon glow ring around the avatar Avatar Focused avatarFocusedLarge centred avatar with a continuously rotating gradient ring All new variants accept the same
NovaHeaderConfigand supportcustomHeaderBuilder,isLoading,showStatusIndicator,actions, and all other existing config fields.
1.1.2 #
- Fix directionality issue
1.1.1 #
- Now it support directionality
1.1.0 #
New Features #
-
Inline body routing via
NovaDrawerBodyRouter: A newbodywidget forNovaDrawerScaffoldthat hosts drawer navigation pages inside the scaffold body using anIndexedStack, so theAppBar,bottomNavigationBar(e.g. aMotionTabBar), and any other scaffold-level widget stay visible no matter which drawer page is active.The classic
Navigator.push/GoRouter.gopattern replaces the entire scaffold — wiping out bottom bars and app bars.NovaDrawerBodyRoutereliminates this problem by keeping the outer scaffold fixed and swapping only the content area:// MotionTabBar lives HERE → always visible, even on drawer pages bottomNavigationBar: MotionTabBar(..., onTabItemSelected: (i) { setState(() { _tabIndex = i; _drawerController.clearSelection(); // return to fallback }); }), // Body swaps between tab content and drawer pages body: NovaDrawerBodyRouter( controller: _drawerController, pages: _inlinePages, fallback: IndexedStack(index: _tabIndex, children: tabWidgets), ), -
NovaDrawerPagemodel: Maps aNovaDrawerItem.idto a lazily-builtWidgetBuilder. Pages that the user never visits are never constructed.Field Type Default Purpose idString– Required. Must match NovaDrawerItem.id.routeString?nullOptional route; used by novaDrawerBodyNavigateto suppress double-navigation.builderWidgetBuilder– Required. Lazily called on first activation. keepAlivebooltrueWhen true, widget state is preserved while the page is hidden. Whenfalse, the subtree is rebuilt fresh on every visit. -
novaDrawerBodyNavigatenavigation helper: Produces anonNavigatecallback forNovaAppDrawerthat intercepts routes handled inline byNovaDrawerBodyRouter(preventing double-navigation) and forwards everything else to your external router:NovaAppDrawer( onNavigate: novaDrawerBodyNavigate( pages: _inlinePages, external: (ctx, route) => GoRouter.of(ctx).go(route), ), ... ) -
Lazy page construction + per-page
keepAlive: Pages are built on first activation only, keeping startup fast regardless of how many pages are registered. SettingkeepAlive: falseon any page discards its widget subtree when the user navigates away, so it rebuilds from scratch on the next visit — useful for pages that must always show fresh server data.
1.0.9 #
New Features #
-
Router-agnostic navigation via
onNavigate(NovaAppDrawer.onNavigate): A new optionalvoid Function(BuildContext context, String route)callback lets you plug in any navigation system — GoRouter, auto_route, Navigator 2.0, or your own custom router — without having to bridge throughonItemTap.When
onNavigateis provided and an item'sroutefield is non-null, the drawer callsonNavigate(context, route)on tap instead of the defaultNavigator.pushNamedfallback, making GoRouter usage trivial:NovaAppDrawer( onNavigate: (context, route) => context.go(route), // GoRouter items: [ NovaDrawerItem(id: 'units', title: 'Units', icon: Icons.straighten_outlined, route: '/settings/units'), NovaDrawerItem(id: 'currencies', title: 'Currencies', icon: Icons.currency_exchange, route: '/settings/currencies'), ], ... )Backward-compatible: if
onNavigateis not set, the drawer falls back toNavigator.of(context).pushNamed(route)exactly as before.The callback is automatically threaded through all internal widgets:
NovaDrawerSectionWidget,NovaNestedMenuItem(full-drawer and mini popup mode), andNovaMiniDrawer. -
onTapper item: EachNovaDrawerItemalready exposes anonTap: VoidCallback?field that is fired on every tap regardless of whether arouteis set, giving you a per-item side-effect hook (analytics, state updates, etc.) alongside the router-level navigation.NovaDrawerItem( id: 'units', title: 'Units', icon: Icons.straighten_outlined, route: '/settings/units', onTap: () => analytics.log('units_tapped'), // fires in addition to navigation )
1.0.8 #
New Features #
-
First-class
entriesAPI (NovaAppDrawer.entries): A newentriesparameter lets you freely interleave standalone items and grouped sections in any order, breaking out of the previous constraint of either a flat item list or a sections list.Two sealed subtypes express each kind of entry:
NovaDrawerItemEntry(NovaDrawerItem)— a standalone item rendered directly in the drawer content area. RespectsisVisibleandisItemHidden.NovaDrawerSectionEntry(NovaDrawerSectionData)— a full collapsible section group that handles its own item filtering as before.
When
entriesis non-empty it takes priority oversections/items, keeping the change fully backward-compatible.NovaAppDrawer( controller: controller, entries: [ NovaDrawerItemEntry(NovaDrawerItem(id: 'home', title: 'Home', icon: Icons.home)), NovaDrawerItemEntry(NovaDrawerItem(id: 'profile', title: 'Profile', icon: Icons.person)), NovaDrawerSectionEntry(NovaDrawerSectionData( id: 'tools', title: 'Tools', items: [ NovaDrawerItem(id: 'search', title: 'Search', icon: Icons.search), NovaDrawerItem(id: 'settings', title: 'Settings', icon: Icons.settings), NovaDrawerItem(id: 'help', title: 'Help', icon: Icons.help_outline), ], )), NovaDrawerItemEntry(NovaDrawerItem(id: 'logout', title: 'Logout', icon: Icons.logout)), ], )
1.0.7 #
Bug Fixes #
-
Mini mode
onItemTapnot firing: WhenNovaDrawerScaffoldrenders the mini drawer, it now falls back toNovaAppDrawer.onItemTapwhen the scaffold-levelonItemTapis not set. Previously, a tap callback placed only onNovaAppDrawerwas silently ignored in mini mode. -
Selected item not highlighted in full drawer (flat items):
NovaAppDrawernow listens to the controller and rebuilds when selection or other state changes. Previously, only items rendered insideNovaDrawerSectionWidgetwould visually update their selected state; items supplied via the flatitemslist did not re-render until an unrelated rebuild occurred.
New Features #
-
Custom mini-drawer expand callback (
NovaDrawerScaffold.onMiniDrawerExpandRequest): A new optionalVoidCallbackonNovaDrawerScaffoldlets you override the default expand-on-toggle / expand-on-hover behaviour. When provided, this callback is invoked instead of the built-incontroller.open(). This gives you full control — run analytics, show a modal, or perform additional side effects before or instead of expanding.NovaDrawerScaffold( onMiniDrawerExpandRequest: () { analytics.track('mini_drawer_expanded'); controller.open(); }, ... )Hover-expand is still gated by
NovaDrawerConfig.enableHoverExpand: true(set on the drawer's config). The delay is controlled byNovaDrawerConfig.hoverExpandDelay.
1.0.6 #
- Fixed onClose not working in drawer
1.0.5 #
- Fixed "setState() or markNeedsBuild() called during build" crash that occurred
when opening the drawer on mobile. The device-type update now runs in a
post-frame callback instead of directly inside
build(), preventingnotifyListeners()from being dispatched while the widget tree is building.
1.0.3 #
- Bug fixes
1.0.2 #
- Novadrawer controller now opens that drawer on overlymode