PlatformDispatcher class Null safety
Platform event dispatcher singleton.
The most basic interface to the host operating system's interface.
This is the central entry point for platform messages and configuration events from the platform.
It exposes the core scheduler API, the input event callback, the graphics drawing API, and other such core services.
It manages the list of the application's views and the screens
attached
to the device, as well as the configuration of various platform
attributes.
Consider avoiding static references to this singleton through
PlatformDispatcher.instance and instead prefer using a binding for
dependency resolution such as WidgetsBinding.instance.platformDispatcher
.
See PlatformDispatcher.instance for more information about why this is
preferred.
- Implementers
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
- brieflyShowPassword → bool
-
Whether briefly displaying the characters as you type in obscured text
fields is enabled in system settings.
read-only
- configuration → PlatformConfiguration
-
The current platform configuration.
read-only
- defaultRouteName → String
-
The route or path that the embedder requested when the application was
launched.
read-only
- frameData → FrameData
-
The FrameData object for the current frame.
read-only
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- initialLifecycleState → String
-
The lifecycle state immediately after dart isolate initialization.
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
- nativeSpellCheckServiceDefined → bool
-
Whether the spell check service is supported on the current platform.
read-only
- onAccessibilityFeaturesChanged ↔ VoidCallback?
-
A callback that is invoked when the value of accessibilityFeatures
changes.
read / write
- onBeginFrame ↔ FrameCallback?
-
A callback invoked when any view begins a frame.
read / write
- onDrawFrame ↔ VoidCallback?
-
A callback that is invoked for each frame after onBeginFrame has
completed and after the microtask queue has been drained.
read / write
- onError ↔ ErrorCallback?
-
A callback that is invoked when an unhandled error occurs in the root
isolate.
read / write
- onFrameDataChanged ↔ VoidCallback?
-
A callback that is invoked when the window updates the FrameData.
read / write
- onKeyData ↔ KeyDataCallback?
-
A callback that is invoked when key data is available.
read / write
- onLocaleChanged ↔ VoidCallback?
-
A callback that is invoked whenever locale changes value.
read / write
- onMetricsChanged ↔ VoidCallback?
-
A callback that is invoked whenever the ViewConfiguration of any of the
views changes.
read / write
- onPlatformBrightnessChanged ↔ VoidCallback?
-
A callback that is invoked whenever platformBrightness changes value.
read / write
- onPlatformConfigurationChanged ↔ VoidCallback?
-
Called when the platform configuration changes.
read / write
- onPlatformMessage ↔ PlatformMessageCallback?
-
Called whenever this platform dispatcher receives a message from a
platform-specific plugin.
read / write
- onPointerDataPacket ↔ PointerDataPacketCallback?
-
A callback that is invoked when pointer data is available.
read / write
- onReportTimings ↔ TimingsCallback?
-
A callback that is invoked to report the FrameTiming of recently
rasterized frames.
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
- onSystemFontFamilyChanged ↔ VoidCallback?
-
A callback that is invoked whenever systemFontFamily changes value.
read / write
- onTextScaleFactorChanged ↔ VoidCallback?
-
A callback that is invoked whenever textScaleFactor changes value.
read / write
- platformBrightness → Brightness
-
The setting indicating the current brightness mode of the host platform.
If the platform has no preference, platformBrightness defaults to
Brightness.light.
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- semanticsEnabled → bool
-
Whether the user has requested that updateSemantics be called when the
semantic contents of a view changes.
read-only
- systemFontFamily → String?
-
The setting indicating the current system font of the host platform.
read-only
- textScaleFactor → double
-
The system-reported text scale.
read-only
-
views
→ Iterable<
FlutterView> -
The current list of views, including top level platform windows used by
the application.
read-only
Methods
-
computePlatformResolvedLocale(
List< Locale> supportedLocales) → Locale? - Performs the platform-native locale resolution.
-
getPersistentIsolateData(
) → ByteData? - The embedder can specify data that the isolate can request synchronously on launch. This accessor fetches that data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
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 platform dispatcher's root isolate.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateSemantics(
SemanticsUpdate update) → void - Change the retained semantics data about this platform dispatcher.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → PlatformDispatcher
-
The PlatformDispatcher singleton.
read-only