CNFoldableState class

Everything CNFoldable knows about the screen the Flutter view is on.

Annotations

Constructors

CNFoldableState({bool isSupported = false, CNHinge? hinge, CNVerticalBarSide verticalBarSide = CNVerticalBarSide.none, List<CNReservedRegion> regions = const <CNReservedRegion>[]})
Creates a state snapshot.
const
CNFoldableState.fromMap(Map<Object?, Object?>? map)
Parses the map sent by the native side.
factory

Properties

activeFold → CNReservedRegion?
The fold content should avoid right now, if any.
no setter
displayFeatures → List<DisplayFeature>
The regions as Flutter DisplayFeatures: an active fold becomes a half-opened DisplayFeatureType.fold and a camera a DisplayFeatureType.cutout. Inactive folds are left out, because content may cross a flat fold. CNFoldableScope puts these into MediaQuery.displayFeatures, which Flutter's dialogs and popups already avoid.
no setter
hashCode → int
The hash code for this object.
no setteroverride
hasVerticalBar → bool
Whether the system uses a vertical bar on this screen.
no setter
hinge → CNHinge?
The hinge, or null when the device has none.
final
isFoldable → bool
Whether this is a foldable device.
no setter
isSupported → bool
Whether the foldable APIs are available (iOS 27.1+, plugin built with the iOS 27.1 SDK). True on every such iPhone, foldable or not.
final
regions → List<CNReservedRegion>
Folds and camera regions, active or not.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
verticalBarSide → CNVerticalBarSide
Where the system's vertical bar is, if it uses one here.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

unsupported → const CNFoldableState
The state on platforms and OS versions without foldable APIs: no hinge, no vertical bar, no regions.