CNFoldable class

Foldable-device state for iPhone Duo: the hinge, the system's vertical bar, and the fold and camera regions.

Wrap the app (or a subtree) in CNFoldableScope and read the state with CNFoldable.of:

final foldable = CNFoldable.of(context);
if (foldable.hinge?.status == CNHingeStatus.partiallyOpen) { ... }

Without a scope, call start and stop yourself and listen to state.

Needs iOS 27.1 and a plugin build with the iOS 27.1 SDK (Xcode 27.1). Every other platform reports CNFoldableState.unsupported.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Static Properties

state → ValueListenable<CNFoldableState>
The latest state. Updates while at least one start is active.
no setter

Static Methods

debugSetState(CNFoldableState value) → void
Overrides the state, for tests and previews.
of(BuildContext context) → CNFoldableState
The state from the nearest CNFoldableScope, rebuilding the caller on every change. Falls back to state (without rebuilds) when there is no scope.
start() → Future<void>
Begins observing. Balanced by stop; observation runs while any caller has started it.
stop() → Future<void>
Ends one start.