duo_kit 0.2.0
duo_kit: ^0.2.0 copied to clipboard
iPhone Duo and foldable layouts for Flutter: navigation in the strip, a split view across the fold and dialogs in one half, around your own widgets.
0.2.0 #
- duo_kit is now a Flutter plugin. On iOS,
FoldBridgepublishes the fold, the camera and the status cluster of iPhone Duo toMediaQuery.displayFeatures, the closed device included. Wrap the app in one:runApp(const FoldBridge(child: MyApp())). On other platforms, on devices without a hinge and without the plugin, as in tests, it passes its child through. FoldHinge.maybeOfgives the status and the angle of the hinge, andFoldGeometry.verticalBarEdgethe edge where the system wants its vertical bar.FoldScaffoldputs the navigation on the edge of the vertical bar where the window has no strip, as on the left of Split View,verticalBarWidthwide. Passnullto keep it at the bottom there.FoldScaffoldcounts the keyboard once: aScaffoldin the body ends above the keyboard and the navigation at the bottom, as above a MaterialbottomNavigationBar, instead of a navigation's height higher. WithresizeToAvoidBottomInset: falsethe body stays above the navigation and the navigation keeps its bottom inset while the keyboard is up.FoldScaffold.navigationBuildergets a context below theMediaQueryof the navigation, soMediaQuery.paddingOf(context)in it gives the padding of the strip or of the bottom edge.FoldSplitView:- Each pane keeps only the display features that overlap it, so a
Navigatorin a pane opens its dialogs and sheets in the pane instead of with no size.FoldGeometry.ofin a pane finds no fold. - Splits in place after a route above it closes, also when it built while covered, and during a page transition is laid out as where its page comes to rest.
- Stops rebuilding on every frame on a kept-alive page out of view.
- Each pane keeps only the display features that overlap it, so a
FoldBridgeScopeinpackage:duo_kit/testing.dartfakes the hinge and the vertical bar edge in tests, andFoldTestPose.duoInnerSplitViewLeftis the window on the left of Split View.
Migrating from 0.1 #
- Replace
FoldableProviderfromfoldable, and occlusions added by hand for the closed device, with oneFoldBridgeabove the app. - The bridge needs Xcode 27.1 (Swift 6.4); with an older Xcode it compiles to nothing. The plugin supports iOS 13.0 and later, like Flutter.
- Read
FoldGeometry.of(context).divisionabove aFoldSplitView, not in its panes. - While the keyboard is up, the body of a
FoldScaffoldnow reaches behind the navigation at the bottom. PassresizeToAvoidBottomInset: falseif it does not resize for the keyboard, to keep it above the navigation as in 0.1. - A
navigationBuilderthat read the window'sMediaQueryfrom its context now reads the navigation's; read the window's above theFoldScaffold. - Drop workarounds for dialogs of a
Navigatorin a pane that opened with no size, and for aFoldSplitViewthat stayed unsplit after a route above it closed. - From
duo_kit_ios:DuoKitIosis nowFoldBridge,DuoKitIos.hingeOfisFoldHinge.maybeOfandDuoKitIos.verticalBarEdgeOfisFoldGeometry.of(context).verticalBarEdge.
0.1.2 #
FoldScaffoldno longer gives a navigation along the bottom edge the top inset, so aSafeAreain it adds no space above it.
0.1.1 #
- The README and the example publish the fold on iOS with
foldable.
0.1.0 #
- Initial release:
FoldGeometry,FoldScaffold,FoldSplitViewandFoldAnchor. FoldScaffoldputs the navigation along the bottom edge or in the strip of the window, on the sideFoldStrip.sidereports.- Development tools in
package:duo_kit/debug.dart:FoldDebugTools,SimulatedFoldandFoldGeometryOverlay. - iPhone Duo poses for tests in
package:duo_kit/testing.dart:FoldTestPose.
