Skip to main content

InertPlatform

Struct InertPlatform 

Source
pub struct InertPlatform;
Expand description

Platform for hand-pumped tests.

Trait Implementations§

Source§

impl Platform for InertPlatform

Source§

fn target_platform(&self) -> TargetPlatform

Android, which is what Flutter’s own test binding defaults debugDefaultTargetPlatform to: a bare App has no host to speak of, and a deterministic answer beats the machine’s.

Source§

fn request_frame(&self, _view: ViewId)

Asks for a frame of view: Flutter’s PlatformDispatcher.scheduleFrame, for one view. Read more
Source§

fn now(&self) -> Instant

The host clock used for frame and timer timestamps.
Source§

fn dispatcher(&self) -> Arc<dyn Dispatcher> ⓘ

The host’s threads, for waking the application or running work off the main thread: see Dispatcher.
Source§

fn views(&self) -> Vec<ViewRef> ⓘ

Every view the app has now: those the platform gave it, such as a phone’s screen or an embedder’s views, and those it asked for. An app may run with none, as one on a desktop does until it asks.
Source§

fn view(&self, _id: ViewId) -> Option<ViewRef>

Looks up one of the app’s views.
Source§

fn request_view(&self, request: ViewRequest) -> Result<RequestId, ViewError>

Asks for a view. A desktop makes a window for it; a platform that gives the app its views and makes none, a phone or an embedder, answers ViewError::Unsupported. The view arrives later, through EmbedderClient::view_added, carrying the id answered here; a request that fails on the way is reported through EmbedderClient::view_request_failed.
Source§

fn request_view_focus_change( &self, view_id: ViewId, state: ViewFocusState, direction: ViewFocusDirection, )

Flutter PlatformDispatcher.requestViewFocusChange: asks the host to move view focus. A host without native focus support ignores the request.
Source§

fn locales(&self) -> Vec<Locale>

The full system-reported supported locales of the device (Flutter PlatformDispatcher.locales), in order of preference; empty until the host reports them.
Source§

fn set_application_locale(&self, locale: &Locale)

Tells the host which locale the application resolved to (Flutter PlatformDispatcher.setApplicationLocale); the default drops it.
Source§

fn platform_brightness(&self) -> Brightness

The platform’s light/dark preference (Flutter PlatformDispatcher.platformBrightness). Read more
Source§

fn default_route_name(&self) -> String

The route the application was started with (Flutter PlatformDispatcher.defaultRouteName). Read more
Source§

fn initial_lifecycle_state(&self) -> Option<AppLifecycleState>

The lifecycle state immediately after the application started (Flutter PlatformDispatcher.initialLifecycleState). Read more
Source§

fn font_source(&self) -> Option<Box<dyn FontSource>>

The platform’s own font lookup: faces by family name and by codepoint, the way Flutter’s engine asks the OS. None for a host without one; text then shapes only against fonts the application registers.
Source§

fn default_font_families(&self) -> Vec<String>

Flutter’s txt::GetDefaultFontFamilies(): the families text uses when its style names none, first match first. Read more
Source§

fn open_image_codec(&self, bytes: Arc<[u8]>) -> ImageCodecFuture

Open an encoded image, answering with a codec for its frames. Read more
Source§

fn import_pixels(&self, pixels: PixelBuffer) -> Option<Image>

An image from pixels the app already holds, with no codec in between: Flutter’s decodeImageFromPixels. None when the host has no renderer to put it on yet.
Source§

fn compositor(&self) -> Option<Arc<dyn Compositor>>

The host’s compositor, where it has one: native surfaces shown beside the framework’s picture. None on the web, on X11, on the inert host, and on an embedder that chose not to have one.
Source§

fn vsync_waiter(&self) -> Option<Arc<dyn VsyncWaiter>>

Flutter’s VsyncWaiter, for any screen: the refreshes the host draws the framework’s frames at, for a producer that paces by them, as a native surface’s does. None for a host without screen ticks.
Source§

fn screens(&self) -> Option<&dyn Screens>

The screens the app’s views are on, and where the pointer is on them (Flutter PlatformDispatcher.displays), or None where the host has none to report. Every host with screens answers, a phone with its one included; a view’s metrics name the screen it is on, and a host that hears the screens change says so through EmbedderClient::screens_changed.
Source§

fn clipboard(&self) -> Option<&dyn Clipboard>

The system clipboard, or None where the host has none.
Source§

fn system_chrome(&self) -> Option<&dyn SystemChrome>

The system UI drawn around the app, or None where the host has none.
Source§

fn haptics(&self) -> Option<&dyn Haptics>

Haptic feedback on the device, or None where the host has none.
Source§

fn system_context_menu(&self) -> Option<&dyn SystemContextMenu>

The system’s own menu over a text selection, or None where the host has none.
Source§

fn popup_menus(&self) -> Option<&dyn PopupMenus>

Native pop-up menus shown at the pointer, or None where the host has none.
Source§

fn text_services(&self) -> Option<&dyn TextServices>

The system services a selection toolbar offers, or None where the host has none.
Source§

fn mouse_cursor(&self) -> Option<&dyn MouseCursor>

The system cursor shown for a pointing device, or None where the host has none.
Source§

fn restoration(&self) -> Option<&dyn Restoration>

Application state kept across relaunches, or None where the host has none.
Source§

fn app_exit(&self) -> Option<&dyn AppExit>

Quitting at the application’s own request, or None where the host cannot quit itself: a phone, a browser tab.
Source§

fn file_opening(&self) -> Option<&dyn FileOpening>

The files the system asks the app to open, or None where the system never asks: it starts the app with them on its command line instead, or has no files to open.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,