DisplayFeature class Null safety

Area of the display that may be obstructed by a hardware feature.

This is populated only on Android.

The bounds are measured in logical pixels. On devices with two screens the coordinate system starts with 0,0 in the top-left corner of the left or top screen and expands to include both screens and the visual space between them.

The type describes the behaviour and if DisplayFeature obstructs the display. For example, DisplayFeatureType.hinge and DisplayFeatureType.cutout both obstruct the display, while DisplayFeatureType.fold does not.

Device with a hinge display feature

Device with a fold display feature

Device with a cutout display feature

The state contains information about the posture for foldable features (DisplayFeatureType.hinge and DisplayFeatureType.fold). The posture is the shape of the display, for example DisplayFeatureState.postureFlat or DisplayFeatureState.postureHalfOpened. For DisplayFeatureType.cutout, the state is not used and has the DisplayFeatureState.unknown value.

Constructors

DisplayFeature({required Rect bounds, required DisplayFeatureType type, required DisplayFeatureState state})
const

Properties

bounds Rect
The area of the flutter view occupied by this display feature, measured in logical pixels.
final
hashCode int
The hash code for this object.
read-onlyoverride
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
state DisplayFeatureState
Posture of display feature, which is populated only for folds and hinges.
final
type DisplayFeatureType
Type of display feature, e.g. hinge, fold, cutout.
final

Methods

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

Operators

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