fold_adaptive_nav 1.7.0
fold_adaptive_nav: ^1.7.0 copied to clipboard
Detects foldables and their posture on iOS and Android, and adapts navigation by itself: bottom bar on phones, thumb rail on cover displays, tablet layouts when open.
1.7.0 #
- Add
AdaptiveNavStyle.look(NavLook.material,.cupertino,.platform): aCupertinoTabBaron phones, iPadOS-style side bars, and this package's side bar in place of Material's rail and drawer. - "More" comes in the app's language (
NavStrings, 21 languages);AdaptiveNavScaffold.moreLabelis now optional. - Ctrl+1–9 (⌘ on Apple keyboards) pick tabs
(
AdaptiveNavScaffold.keyboardShortcuts). - Add
AdaptiveNavScaffold.restorationId: the open tab group and the expanded side bar's state survive the system ending the app. FoldSplitViewandAdaptiveListDetailtakeminPaneExtent(280 pt). On a flat device, a fold that would leave a pane narrower — a side bar beside the view — gives way to a split by ratio, or to one pane. Half open, the split stays at the fold. Set it to 0 for the old behaviour.- Every public member is documented.
- The example has a Look setting, restores its state, and an Android integration test that CI runs on a foldable emulator.
- New: a go_router example, a migration guide from
flutter_adaptive_scaffold, and a demo GIF. - The example and the go_router example open with a side bar on opened
foldables and tablets (
TabletNavigation.rail). - New iPhone Duo screenshots: the side bar, turning, split screen and flows.
1.6.0 #
- Add
TabletNavigation.railInLandscape: a bottom bar while the window is taller than wide, a side bar while it is wider, for opened foldables turned on their side. The default staysbottomBar. - Add
TabletRailStyle.expanded(FoldAdaptiveConfig.tabletRailStyle): a 240 pt side bar with the labels beside the icons, which a menu button collapses to an icon rail and back (expandedRailCollapsible,expandedRailStartsCollapsed,AdaptiveNavStyle.expandedRailWidth). - Add tab groups:
AdaptiveNavScaffold.groupedandNavGroup. Side bars and the cover rail show them as an accordion, one group open at a time; bottom bars list every tab; the drawer shows them as headings (AdaptiveNavStyle.groupBackgroundColor). - Add
FoldAdaptiveConfig.tabletRailAlignment(top, center, bottom) for this package's tablet side bar. SideRailtakesgroups,openGroup,onGroupTap,expandedandleading.- Fix: an app in split screen on an opened foldable got the cover rail when its window was squat (half of an opened iPhone Duo on its side). An opened foldable is never on its cover; split screen gets the phone layout.
- Add the
iPhoneDuoSplitScreenandpixelFoldSplitScreenpresets. - The example's settings try the side bar styles, alignment and groups.
1.5.0 #
- The bottom bar on tablets and opened foldables is full width by default:
FoldAdaptiveConfig.tabletBottomBarMaxWidthnow defaults todouble.infinity. Set it to 560 for the old look. - Add
AdaptiveNavStyle.barMaxWidth, to cap the bottom bar from the theme or per screen, on every form factor. It wins over the config. - A capped flat bar keeps its background edge to edge and caps only its tabs.
1.4.1 #
- New screenshots from a Pixel 10 Pro Fold and an iPhone Duo: list and detail at the fold, tabletop, the cover thumb column and More.
1.4.0 #
- Add
AdaptiveListDetail: a list and its open item, side by side at the fold or on wide tablets, one at a time on phones, where back closes the item. AdaptiveNavScaffoldshows at mostmaxBarDestinations(5) tabs on the bottom bar and the cover rail; the rest go behind a "More" tab (moreLabel,moreIcon).- Add
FoldAdaptiveConfig.drawerFromWidth: a permanentNavigationDraweron wide tablets. - Add
AdaptiveNavScaffold.hideBarOnScroll. - Cover rail labels wrap onto two lines and the rail scrolls when its tabs don't fit, instead of overflowing with large text. Rail tabs keep a 48 pt touch target. Reduced motion turns off the rail, bar and hide animations.
FoldDevicePreset.galaxyZFlipCoveris now 411 × 427 pt, the Galaxy Z Flip5's cover at its usual density.- Add
FoldSplitView.isSplitOf, to show a back button only when a pane is alone. - The example shows every feature: list and detail, tabletop, adaptive grid and sheets, More, drawer, hide-on-scroll and the debug overlay, with a test that runs it on every device preset.
1.3.0 #
- Opened flip phones (Galaxy Z Flip, Razr) follow
lockPhonesToPortraitlike any phone instead of turning freely. A phone-sized window with a fold in it counts as a flip;FoldAdaptiveConfig.treatOpenedFlipsAsPhones: falserestores the old behaviour. - Covers narrower than
FoldAdaptiveConfig.compactCoverRailBelow(400 pt) get a compact, 64 pt rail without labels (AdaptiveNavStyle.compactRailWidth). - Add
FoldAdaptiveConfig.coverMinShortestSide, to give narrow covers the phone layout, andFoldAdaptiveConfig.formFactorResolver, to decide the form factor yourself. - Add
FoldSplitViewandresolveFoldSplit: two panes that meet at the fold, or split a wide tablet window. - Add
TabletopLayoutfor half-open devices with the fold across. - Add
FoldSafeAreaandcameraInsets, to keep content clear of camera housings. - Add
WindowSizeClass,context.windowSizeClass,context.adaptiveandAdaptiveBuilder. - Add
FoldListenerfor posture and form factor changes. - Add
showAdaptiveSheet: a bottom sheet on phones, a dialog on tablets. - Add
FoldDevicePresetandFoldPreview, to render an app as on a foldable in tests and previews. - Add
FoldDebugOverlay.
1.2.1 #
- Fix the blank strip under the bottom bar on phones with a home indicator. A flat bar now fills that area to the screen edge; a floating bar overlaps its empty part (21 pt from the bottom on an iPhone instead of 34 pt).
1.2.0 #
- Add
FoldAdaptiveConfig.coverRailAlignment(top,center,bottom): withcoverRailSide, picks the corner of the cover display the tabs sit in. SideRailtakes an optionalalignment.
1.1.0 #
- Add
NavDestination.customfor SVG, PNG or any widget as a tab icon.NavDestination.iconis now nullable. - Add
AdaptiveNavStyle, as a theme extension orAdaptiveNavScaffold.style: colors, indicator, label styles and visibility, icon size, bar height, corners and margin, rail width and alignment, animation speed. - Add
NavDestination.badgeandNavDestination.enabled. - Add
AdaptiveNavScaffold.backgroundColor.
1.0.1 #
- Add screenshots from a Pixel Fold and an iPhone Duo.
1.0.0 #
- Initial release.
