drawer_rail 0.5.0
drawer_rail: ^0.5.0 copied to clipboard
A collapsible, themeable side navigation drawer with a full-width panel and a narrow icon rail: search, sections, badges, expandable groups and flyouts.
Changelog #
0.5.0 #
A bug-hunting release: everything below except the new API was found by reading the widget back against what its own comments claimed it did, then written up as a failing test first. The suite grew from 36 tests to 52.
Hover, when the pointer keeps moving #
- Fix: sweeping from one group to the next stranded the first one open. All groups shared a single timer, so entering the second group cancelled the pending close of the one just left — and it then stayed open for good, since the bookkeeping had already moved on. Each group now keeps its own timer.
- Fix: in the collapsed rail, the same bug meant the next flyout never opened at all — the shared timer resolved to the wrong action. Rail flyouts now swap cleanly, and only one is ever open at a time.
- Fix: a rail flyout opened straight over the buttons below it, so the group
underneath an open one could not be reached — fatal with
groupTrigger: hover, where the pointer has to travel through the overlay to get anywhere. Flyouts now open beside the rail, and mirror correctly withposition: right. - Fix: a drawer torn down mid-peek left
hoverPeekingstuck on, so a controller outliving the drawer reported the wrongrailCollapsedfrom then on.DrawerRailnow hands the controller back clean. - Fix: a group with no children opened an empty flyout. It now opens nothing.
Layout #
- Fix: the content slid sideways for the whole collapse/expand animation.
The
OverflowBoxmeant to lay the content out at its target width inherited the animating container's tightminWidthas a floor, so it never did — the content was laid out at the animating width and centred instead. It is now anchored against the edge that does not move, so the rail is revealed rather than squeezed: no re-wrapping, no mid-animation ellipsis, no drift. Withposition: rightthe anchor flips with it.
Search #
- Fix: searching a group's name found nothing. Only children were matched,
so
Reportscame back empty unless a child happened to carry the word too. A group that matches now offers all of its children. - Fix: a query left running behind the rail silently filtered the panel the next time it opened, with nothing on screen to explain the missing entries. Pinning the drawer collapsed now clears the search. A hover peek or auto-hide is transient and deliberately leaves what you typed alone.
Motion and accessibility #
- Fix:
pressedScalewas captured once ininitState, so changing it — or a theme change that changed it — went unnoticed for the life of the card. - Fix: reduced motion did not reach the press micro-scale. Items went on
shrinking under the pointer even with
MediaQuery.disableAnimationsset. A scale is movement however short its duration, soDrawerRailTheme.resolvenow forcespressedScaleto1under reduced motion rather than merely running it faster. - Add
DrawerRailTheme.pressAnimationDurationand the matching parameter onAnimatedPressCard(default 140ms), so the press micro-scale is as tunable as every other animation.
Housekeeping #
- Add
DrawerRailController.resetHoverState(): clearshoverPeekingandhoverHiddenwithout touching the pinnedcollapsed.DrawerRailcalls it on teardown; it is a no-op on an already-disposed controller, so teardown order stays the caller's to choose. - Add
DrawerRailLabels.copyWith, and value equality onDrawerRailLabelsandDrawerBadge— they can now be asserted on directly in tests. - Fix: per-group state grew without bound. Menu controllers and timers for
groups that no longer exist are now dropped when
entrieschanges. - Fix: a dartdoc link pointed at
NovaDrawer, a type that does not exist — a leftover from an old rename. - README: a section of its own for search, the pub.dev badge now that the package is published, and the reduce-motion and flyout behavior documented as it now actually is.
0.4.0 #
Hover: opening and closing #
- Add
DrawerRailTheme.hoverAdaptive(), a one-line preset that makes the drawer pointer-driven: rail and groups switch to hover,railAutoCollapseturns on, andlinkTriggerdeliberately stays onclick. Passbase:to layer it over your own styling. - Add
DrawerRailTheme.railAutoCollapse(defaultfalse) andhoverAutoCollapseDelay(default 450ms). WithrailTrigger: hover, leaving the drawer now also closes one the user left expanded, making hover symmetric. Off by default because it takes away a panel someone pinned open. - Add
DrawerRailController.hoverHiddenandsetHoverHidden, the mirror ofhoverPeeking. Like a peek, an auto-collapse never writescollapsed, so the state you persist still survives a passing mouse. - Fix: a group opened by hover now closes when the panel itself closes, instead of still sitting open the next time the drawer is revealed.
- Fix: an explicit collapse/expand now also cancels an auto-hide in flight, not just a peek.
Cursors #
- Add
DrawerRailTheme.clickableCursor(defaultSystemMouseCursors.click) andinertCursor(defaultSystemMouseCursors.basic), plus matching parameters onAnimatedPressCard. Every clickable surface now states its cursor rather than inheriting one, and the drawer's own chrome states the arrow — so the pointer reliably reverts when it leaves an item.
Motion #
- Add
groupAnimationCurve,hoverAnimationDurationandhoverAnimationCurve. - Fix: the group unfold used a linear height tween, which read as mechanical
next to the eased width animation. It and the chevron rotation now follow
groupAnimationCurve. - Fix: the item hover shadow/tint appeared and vanished in a single frame. It
now fades over
hoverAnimationDuration. - Fix: hovering a selected item replaced its pill color with the drawer surface. An already-opaque background is now kept as the shadow's backing surface, so the pill keeps its color and just lifts.
- Items now spring back from a press with a slight overshoot instead of easing flatly back to size.
- Honour
MediaQuery.disableAnimations: every animation duration collapses to zero when the platform asks for reduced motion. Hover delays are kept — they gate an interaction, not a motion effect.DrawerRailTheme.resolvetakes a new optionalreduceMotionflag.
Other #
- Add
DrawerRailTheme.copyWith. - The hover-shadow regression helper moved back to matching
AnimatedContainer, because the card genuinely renders one now. The 0.3.0 note below was correct at the time and is simply no longer true. - Rewrite the README: every theme field now documents what it turns on and what visibly moves, and the example app got live switches for Open on hover and Close on exit.
0.3.0 #
- Add
DrawerActivationMode(click/hover) and three theme fields that choose how each interaction is triggered on web and desktop:DrawerRailTheme.railTrigger(pointer peeks the collapsed rail open),groupTrigger(pointer opens groups inline and as rail flyouts) andlinkTrigger(pointer activates a link after a dwell). All default toclick, so existing behavior is unchanged. - Add
hoverOpenDelay,hoverCloseDelayandhoverSelectDelayto tune the hover timings. The close delay is what lets the pointer travel from a rail button to its flyout without the menu snapping shut. - Add
DrawerRailController.hoverPeeking,railCollapsedandsetGroupExpanded. A hover peek widens the rail without changingcollapsed, so the state you persist survives a passing mouse; readrailCollapsedfor the width actually on screen. - Hover never replaces tap: every item stays clickable in every mode, so touch platforms — where hover events never fire — are unaffected.
- Fix two hover regression tests that were passing vacuously: the helper looked
for an
AnimatedContainerunderAnimatedPressCard, which renders a plainContainer, so it never inspected anything.
0.2.1 #
- Fix visual bug where hover effect was applied as an overlay affecting foreground legibility. Hover now strictly alters the background color using InkWell, keeping text and icons at 100% opacity.
0.2.0 #
- Add
DrawerRailTheme.hoverEffect(DrawerHoverEffect.shadow/.highlight/.none) so the item hover feedback can be switched or turned off, plushoverHighlightColorfor the highlight variant. - Fix the murky/cloudy look of the hover shadow: in
shadowmode an opaque surface is now painted behind the card, so the shadow reads as a lift instead of a colored haze bleeding through transparent items.
0.1.0 #
Initial release.
DrawerRail: collapsible side navigation drawer with an expanded panel and a narrow icon rail.- Built-in diacritic-insensitive search, uppercase section headers, selected pill, text/count badges, inline-expandable groups and collapsed flyout menus.
DrawerRailController(ChangeNotifier) for collapse, selection and group state — no external state-management dependency.DrawerRailLabelsfor localizing the built-in chrome.- Customizable header and footer slots via builders.
- Fully customizable
DrawerRailTheme, falling back to the ambientColorScheme:- Sizing/spacing:
expandedWidth,railWidth,iconSize,railIconSize,railItemHeight,borderRadius,itemBorderRadius,contentPadding,itemPadding,groupChildIndent. - Text styles:
labelTextStyle,selectedLabelTextStyle,sectionTextStyle,badgeTextStyle, plussectionUppercase. - Chrome icons:
collapseIcon,expandIcon,searchIcon,clearSearchIcon,groupTrailingIcon. - Motion:
animationDuration,animationCurve,groupAnimationDuration,pressedScale. - Layout:
DrawerRailPosition(left/right).
- Sizing/spacing:
DrawerRail.searchDecorationto fully override the search field, andDrawerRail.showFooterDivider.