Window class

The most basic interface to the host operating system's user interface.

There is a single Window instance in the system, which you can obtain from the window property.

Properties

accessibilityFeatures AccessibilityFeatures
Additional accessibility features that may be enabled by the platform.
read-only
alwaysUse24HourFormat bool
The setting indicating whether time should always be shown in the 24-hour format. [...]
read-only
defaultRouteName String
The route or path that the embedder requested when the application was launched. [...]
read-only
devicePixelRatio double
The number of device pixels for each logical pixel. This number might not be a power of two. Indeed, it might not even be an integer. For example, the Nexus 6 has a device pixel ratio of 3.5. [...]
read-only
locale Locale
The system-reported default locale of the device. [...]
read-only
locales List<Locale>
The full system-reported supported locales of the device. [...]
read-only
onAccessibilityFeaturesChanged VoidCallback
A callback that is invoked when the value of accessibilityFlags changes. [...]
read / write
onBeginFrame FrameCallback
A callback that is invoked to notify the application that it is an appropriate time to provide a scene using the SceneBuilder API and the render method. When possible, this is driven by the hardware VSync signal. This is only called if scheduleFrame has been called since the last time this callback was invoked. [...]
read / write
onDrawFrame VoidCallback
A callback that is invoked for each frame after onBeginFrame has completed and after the microtask queue has been drained. This can be used to implement a second phase of frame rendering that happens after any deferred work queued by the onBeginFrame phase. [...]
read / write
onLocaleChanged VoidCallback
A callback that is invoked whenever locale changes value. [...]
read / write
onMetricsChanged VoidCallback
A callback that is invoked whenever the devicePixelRatio, physicalSize, padding, or viewInsets values change, for example when the device is rotated or when the application is resized (e.g. when showing applications side-by-side on Android). [...]
read / write
onPlatformMessage PlatformMessageCallback
Called whenever this window receives a message from a platform-specific plugin. [...]
read / write
onPointerDataPacket PointerDataPacketCallback
A callback that is invoked when pointer data is available. [...]
read / write
onSemanticsAction SemanticsActionCallback
A callback that is invoked whenever the user requests an action to be performed. [...]
read / write
onSemanticsEnabledChanged VoidCallback
A callback that is invoked when the value of semanticsEnabled changes. [...]
read / write
onTextScaleFactorChanged VoidCallback
A callback that is invoked whenever textScaleFactor changes value. [...]
read / write
padding WindowPadding
The number of physical pixels on each side of the display rectangle into which the application can render, but which may be partially obscured by system UI (such as the system notification area), or or physical intrusions in the display (e.g. overscan regions on television screens or phone sensor housings). [...]
read-only
physicalSize Size
The dimensions of the rectangle into which the application will be drawn, in physical pixels. [...]
read-only
semanticsEnabled bool
Whether the user has requested that updateSemantics be called when the semantic contents of window changes. [...]
read-only
textScaleFactor double
The system-reported text scale. [...]
read-only
viewInsets WindowPadding
The number of physical pixels on each side of the display rectangle into which the application can render, but over which the operating system will likely place system UI, such as the keyboard, that fully obscures any content. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

render(Scene scene) → void
Updates the application's rendering on the GPU with the newly provided Scene. This function must be called within the scope of the onBeginFrame or onDrawFrame callbacks being invoked. If this function is called a second time during a single onBeginFrame/onDrawFrame callback sequence or called outside the scope of those callbacks, the call will be ignored. [...]
scheduleFrame() → void
Requests that, at the next appropriate opportunity, the onBeginFrame and onDrawFrame callbacks be invoked. [...]
sendPlatformMessage(String name, ByteData data, PlatformMessageResponseCallback callback) → void
Sends a message to a platform-specific plugin. [...]
setIsolateDebugName(String name) → void
Set the debug name associated with this window's root isolate. [...]
updateSemantics(SemanticsUpdate update) → void
Change the retained semantics data about this window. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited