DisplayUnitInfo constructor
DisplayUnitInfo({
- required String id,
- required String name,
- Edid? edid,
- required String mirroringSourceId,
- required List<
String> mirroringDestinationIds, - required bool isPrimary,
- required bool isInternal,
- required bool isEnabled,
- required ActiveState activeState,
- required bool isUnified,
- bool? isAutoRotationAllowed,
- required double dpiX,
- required double dpiY,
- required int rotation,
- required Bounds bounds,
- required Insets overscan,
- required Bounds workArea,
- required List<
DisplayMode> modes, - required bool hasTouchSupport,
- required bool hasAccelerometerSupport,
- required List<
double> availableDisplayZoomFactors, - required double displayZoomFactor,
Implementation
DisplayUnitInfo({
/// The unique identifier of the display.
required String id,
/// The user-friendly name (e.g. "HP LCD monitor").
required String name,
/// NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
Edid? edid,
/// Chrome OS only. Identifier of the display that is being mirrored if
/// mirroring is enabled, otherwise empty. This will be set for all displays
/// (including the display being mirrored).
required String mirroringSourceId,
/// Chrome OS only. Identifiers of the displays to which the source display
/// is being mirrored. Empty if no displays are being mirrored. This will be
/// set to the same value for all displays. This must not include
/// |mirroringSourceId|.
required List<String> mirroringDestinationIds,
/// True if this is the primary display.
required bool isPrimary,
/// True if this is an internal display.
required bool isInternal,
/// True if this display is enabled.
required bool isEnabled,
/// Active if the display is detected and used by the system.
required ActiveState activeState,
/// True for all displays when in unified desktop mode. See documentation
/// for [enableUnifiedDesktop].
required bool isUnified,
/// True when the auto-rotation is allowed. It happens when the device is in
/// a tablet physical state or kSupportsClamshellAutoRotation is set.
/// Provided for ChromeOS Settings UI only. TODO(stevenjb): Remove when
/// Settings switches to a mojo API.
bool? isAutoRotationAllowed,
/// The number of pixels per inch along the x-axis.
required double dpiX,
/// The number of pixels per inch along the y-axis.
required double dpiY,
/// The display's clockwise rotation in degrees relative to the vertical
/// position.
/// Currently exposed only on ChromeOS. Will be set to 0 on other platforms.
/// A value of -1 will be interpreted as auto-rotate when the device is in
/// a physical tablet state.
required int rotation,
/// The display's logical bounds.
required Bounds bounds,
/// The display's insets within its screen's bounds.
/// Currently exposed only on ChromeOS. Will be set to empty insets on
/// other platforms.
required Insets overscan,
/// The usable work area of the display within the display bounds. The work
/// area excludes areas of the display reserved for OS, for example taskbar
/// and launcher.
required Bounds workArea,
/// The list of available display modes. The current mode will have
/// isSelected=true. Only available on Chrome OS. Will be set to an empty
/// array on other platforms.
required List<DisplayMode> modes,
/// True if this display has a touch input device associated with it.
required bool hasTouchSupport,
/// True if this display has an accelerometer associated with it.
/// Provided for ChromeOS Settings UI only. TODO(stevenjb): Remove when
/// Settings switches to a mojo API. NOTE: The name of this may change.
required bool hasAccelerometerSupport,
/// A list of zoom factor values that can be set for the display.
required List<double> availableDisplayZoomFactors,
/// The ratio between the display's current and default zoom.
/// For example, value 1 is equivalent to 100% zoom, and value 1.5 is
/// equivalent to 150% zoom.
required double displayZoomFactor,
}) : _wrapped = $js.DisplayUnitInfo(
id: id,
name: name,
edid: edid?.toJS,
mirroringSourceId: mirroringSourceId,
mirroringDestinationIds: mirroringDestinationIds.toJSArray((e) => e),
isPrimary: isPrimary,
isInternal: isInternal,
isEnabled: isEnabled,
activeState: activeState.toJS,
isUnified: isUnified,
isAutoRotationAllowed: isAutoRotationAllowed,
dpiX: dpiX,
dpiY: dpiY,
rotation: rotation,
bounds: bounds.toJS,
overscan: overscan.toJS,
workArea: workArea.toJS,
modes: modes.toJSArray((e) => e.toJS),
hasTouchSupport: hasTouchSupport,
hasAccelerometerSupport: hasAccelerometerSupport,
availableDisplayZoomFactors:
availableDisplayZoomFactors.toJSArray((e) => e),
displayZoomFactor: displayZoomFactor,
);