twin_screen 0.4.5
twin_screen: ^0.4.5 copied to clipboard
Fold-aware and dual-screen layouts for Flutter: iPhone Duo, Android foldables and flip phones, and web, plus window size classes and a fold simulator.
0.4.5 #
- iOS: when the system reports no division region (the iOS 27.1 simulator never does), the fold is now estimated as a line through the middle of the whole screen, across its long side. This is a heuristic, not a measurement. A real division region, when there is one, is used instead. The estimate is not made while the device is closed.
0.4.4 #
TwinPane.hiddenPanewithTwinHiddenPane.dispose(default),keepand the newkeepOnceShown: a pane is built only once it has been shown, then kept with its state while hidden.TwinListDetailuses it, so an unopened detail is no longer built on a phone.TwinPane.maintainHiddenPaneis deprecated; it meansTwinHiddenPane.keep.
0.4.3 #
TwinPane.isSplitOf(context): whether the nearestTwinPaneabove shows both panes, using the layout's own rules.TwinListDetail.isSplitOfnow delegates to it. The example app uses it instead of repeating the rules.
0.4.2 #
- The iOS podspec version was stuck at 0.1.0; it now matches
pubspec.yaml, and a test keeps them in sync.
0.4.1 #
- The iPhone Duo simulator preset now matches the real window: 871 × 669 pt on the unfolded screen (the right 80 pt hold the status column), with the fold at 475.5 pt, the middle of the 951 pt screen.
- New
TwinDevicePreset.innerEndInsetanddefaultOrientation. Picking a preset, or creating aTwinSimulatorControllerwithoutorientation:, now uses the preset's default orientation. iPhone Duo opens in landscape (book) instead of portrait (tabletop).
0.4.0 #
TwinNavigationandTwinDestination: navigation that adapts to the window and the fold. A bottom bar on compact windows, a rail on medium ones, an extended rail on expanded ones, and always a rail beside a separating vertical hinge. Override withTwinNavigationLayout.
0.3.0 #
TwinListDetail: a list and its detail view. Side by side when the window splits (fold, hinge, or a medium or larger window), one at a time otherwise, with the back gesture callingonDetailClosed. Both views keep their state.TwinListDetail.isSplitOf(context)tells a view which layout it is in.TwinPane.maintainHiddenPane: keeps a hidden pane in the tree, off screen, so it keeps its state. Off by default.
0.2.0 #
showFoldAwareBottomSheetandFoldAwareBottomSheetRoute: a modal bottom sheet that rises on one side of the fold. Same placement rules asshowFoldAwareDialog(anchorPoint,preferredSide,allowSpanning) and the same options asshowModalBottomSheet.
0.1.0 #
First release.
TwinScreenScopeandTwinScreen.of: device type, posture, hinge angle, hinge bounds, segments, window class, data source and a combinedmode(standard,cover,singlePane,dualPane,book,tabletop). Widgets can depend on one aspect only.TwinScreen.hingeAngleStreamOffor hinge angle updates without rebuilds.- Fills
MediaQuery.displayFeatureson iOS and web, so Flutter's own fold-aware widgets work there too. Folds Flutter already reports are kept. TwinPane: two panes split at the fold, with window-class fallbacks and RTL support.showFoldAwareDialogandFoldAwareDialog: dialogs on the side of the anchor point orpreferredSide, optionally spanning both sides.WindowClass,WindowClassBreakpointsandWindowClassBuilder: Material 3 window size classes with custom breakpoints.TwinDebugOverlay: draws segments, the hinge and cutouts, shows a draggable info panel, and simulates iPhone Duo, Galaxy Z Fold, Galaxy Z Flip, Pixel Fold, Surface Duo and Xiaomi Mix Flip. Off in release builds by default.- Android: hinge sensor, posture and angle stream, cover-screen detection, book versus flip detection, and a remembered device type.
- iOS 27.1+ (preview):
UIHingeInteractionand reserved regions, reached at run time so the plugin builds with any Xcode. The cover screen and the hardware check are verified in the simulator; the open and half-open states are not yet confirmed on an unfolded device. Requires iOS 15.0 or later. - Web: Viewport Segments and Device Posture APIs.
- macOS, Windows and Linux: an ordinary device; window classes and the simulator still work.
- The app below the scope, and each
TwinPanepane, keep their state when the device folds or unfolds. - Guides in
doc/, screenshots, and an example app covering every feature. - A guide for AI coding agents (
doc/ai-agents.md): a rules block to paste intoCLAUDE.md,AGENTS.md, Cursor or Copilot instructions, prompts that work well, and the mistakes agents make most often. - Requires Flutter 3.32 or later. Android: API 21+, with Android Gradle Plugin 8 or 9 (built-in Kotlin or the Kotlin plugin).