fold_kit 1.1.0
fold_kit: ^1.1.0 copied to clipboard
Foldables and large screens in Flutter: iPhone Duo and Android fold position, posture, hinge angle, two-pane layouts and iPhone Duo-style vertical bars.
1.1.0 #
FoldScaffoldreads your native bars: pass aNavigationBar,BottomNavigationBarorCupertinoTabBarasbottomNavigationBarand its tabs, selection and tap callback go into the vertical bar on iPhone Duo — nodestinationsneeded. RenamingScaffoldis the whole migration.- Vertical bar looks native on iPhone Duo: it sits in the status strip on the right, below the
clock (no extra band, the page keeps its width), with icon-only buttons in capsules: back, actions,
tabs.
FoldBarTheme.backgroundColornow colors the capsules;labelStyleis deprecated. - Glass look:
FoldBarTheme(glass: true)makes the capsules blurred, see-through glass, and on phones turns the tabs built fromdestinationsinto a floating glass tab bar. - Drop-in for big apps:
FoldScaffoldalso takesbottomSheet,floatingActionButtonLocation,persistentFooterButtons,extendBodyandextendBodyBehindAppBar, so renamingScaffoldcompiles. - Right-to-left languages: the iPhone Duo bar stays in the status strip on the right.
FoldDevice.innerPadding:FoldPreviewshows the iPhone Duo status strip on the open display too.FoldTwoPaneoptions:splitWhen(e.g. split only while half open),splitWithoutFold(tablets stay one page) andhinge(a widget in the fold gap).FoldLayoutBuilder: the fold mapped into any widget (LocalFold.start/end/rect), for layouts like "keep the canvas above a tabletop fold".FoldAngleController: live hinge angle for protractor-style features, withhold()that takes the value from just before the tap.FoldBarTheme.topInsetoverrides where the iPhone Duo bar starts below the clock.- Android: a hinge angle under 15° counts as
closed(outer display); bars stay at the bottom there. - Catalog: Pixel 9 Pro Fold (measured on the emulator).
- Vertical bar is your choice:
FoldBarPlacement.autonow also goes vertical on any window 840+ wide (open Android foldables, tablets in portrait);verticalWhensets your own rule,verticalBarBuilderdraws the whole bar fromFoldBarContent,FoldBarTheme.widthsizes it. - Package rule: every public member is documented (
public_member_api_docson). - Hinge angle listener:
FoldListener(onAngleChanged: …)andFoldKit.anglesstream.FoldListener.onChangedis now optional.
1.0.0 #
First stable release: one foldable and large-screen API for every device.
FoldPreview: run any screen as iPhone Duo, Galaxy Z Fold or iPad (closed, half open, flat, portrait) on any screen or in widget tests, with the fold painted on top and an optional toolbar. Build foldable layouts without a foldable.- Device catalog (
FoldDevices): measured sizes and folds of current foldables and tablets;FoldDevices.refresh()(opt-in) pulls the latest list from monsware.com/foldkit/models. dart run fold_kit:audit: lists code and settings that break on foldables, tablets and Split View (screen-size math, orientation locks,inactivepauses,UIRequiresFullScreen,screenOrientation…).--fatalfor CI.FoldBuilder,FoldListener,FoldKit.changes: oneFoldStatewith posture, hinge angle, device (model id + catalog name) andisOpen/isClosed/isFoldable— render your own foldable layout when it is open, your normal page otherwise.- Easy migration:
FoldScaffoldkeeps your ownappBarandbottomNavigationBaron phones, adds no app bar when you have none, takesWidgeticons (badges work) and reuses yourBottomNavigationBarItems viaFoldDestination.fromItem;FoldBarThemematches your colors. FoldKitScopefollows rotation and window resizing (MediaQuery used to keep the first size on Android, web and desktop).fold_kit:auditflagsUIRequiresFullScreenonly when it istrue.FoldScaffold: screen readers can press the vertical bar buttons; your ownAppBar's title, leading and actions show in the vertical layout too; the bar scrolls instead of overflowing on short windows;drawerandendDrawerare passed through, so renamingScaffoldworks for apps with a drawer.FoldDeviceequality byid:FoldPreviewkeeps its selection afterFoldDevices.refresh().- iOS hinge angle is reported in degrees (UIKit gives radians); fully open is 180.
- Everything from 0.1.0 below.
0.1.0 (not published, part of 1.0.0) #
- iPhone Duo:
FoldKitScopereads the fold (reserved division region) and the hinge status on iOS 27.1 and puts the fold intoMediaQuery.displayFeatures, like Flutter does on Android.FoldInfo.posturenow reportsclosedandflattoo. Builds with Xcode 27.0 as well (no-op there). FoldScaffold: app bar and tabs move into one vertical bar on the right where iOS does that for native apps (Duo outer display, inner display in landscape); normal app bar + navigation bar elsewhere. Overflow menu, prominent actions, priorities; the body keeps its state.FoldTwoPane: two panes split exactly at the fold (book or tabletop), by ratio on wide windows without a fold, one pane on phones.FoldAvoid: keeps hand-positioned buttons off the hinge.- Hinge angle:
FoldKitScope.angleOf(context)on iPhone Duo and Android foldables (API 30+ hinge sensor). - New logo.
0.0.1 #
FoldInfo.of(context): fold rect, axis, posture (none / closed / halfOpen / flat) and window size class.WindowSizeClass(compact / medium / expanded, Material 3 breakpoints).- Android foldables supported through Flutter's display features; iPhone Duo support comes in 0.1.
