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)

Requests one isolate frame at the host’s next appropriate opportunity.
Source§

fn now(&self) -> Instant

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

fn wake_at(&self, _deadline: Instant)

Asks the host to wake the application at deadline.
Source§

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

Current host-provided views.
Source§

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

Looks up a current host-provided view.
Source§

fn implicit_view(&self) -> Option<ViewRef>

The stable implicit view, when this embedding provides one.
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 handles_text_editing_keys(&self) -> bool

Whether the host’s own text input turns editing keys into edits before the framework sees them — backspace and delete, caret movement, the line and document ends. Read more
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 default_route_name(&self) -> String

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

fn set_application_switcher_description( &self, description: &ApplicationSwitcherDescription, )

Describes the app in the host’s application switcher (Flutter SystemChrome.setApplicationSwitcherDescription); the default drops it.
Source§

fn set_system_ui_overlay_style(&self, style: &SystemUiOverlayStyle)

Styles the system overlays the host draws over the app — the status bar, and on Android the system navigation bar (Flutter SystemChrome.setSystemUIOverlayStyle); the default drops it.
Source§

fn haptic_feedback(&self, kind: HapticFeedbackType)

Plays haptic feedback on the device (Flutter’s HapticFeedback.vibrate message on SystemChannels.platform); the default drops it.
Source§

fn clipboard_set_data(&self, text: &str)

Stores plain text on the system clipboard (Flutter’s Clipboard.setData message on SystemChannels.platform); the default drops it.
Source§

fn clipboard_get_data(&self) -> Option<String>

Retrieves plain text from the system clipboard (Flutter’s Clipboard.getData); the default answers None.
Source§

fn clipboard_has_strings(&self) -> bool

Whether the clipboard contains string data (Flutter’s Clipboard.hasStrings); the default answers false.
Source§

fn supports_showing_system_context_menu(&self) -> bool

Whether this host can show a system-rendered context menu (Flutter PlatformDispatcher.supportsShowingSystemContextMenu). Read more
Source§

fn show_system_context_menu( &self, target_rect: Rect, items: Option<&[SystemContextMenuItem]>, )

Shows the system context menu (Flutter’s ContextMenu.showSystemContextMenu). Read more
Source§

fn hide_system_context_menu(&self)

Hides the system context menu (Flutter’s ContextMenu.hideSystemContextMenu). Read more
Source§

fn show_popup_menu(&self, entries: &[PopupMenuEntry]) -> Option<usize>

Shows entries as the platform’s own popup menu at the pointer and waits for it to close; answers the index of the entry chosen. Not a Flutter call: Flutter’s context menus draw inside the view, and a desktop panel narrower than its menu needs the system’s, which is its own window. Read more
Source§

fn look_up(&self, text: &str)

Looks up the given text (Flutter’s LookUp.invoke). Read more
Source§

fn search_web(&self, text: &str)

Searches the web for the given text (Flutter’s SearchWeb.invoke). Read more
Source§

fn share(&self, text: &str)

Shares the given text (Flutter’s Share.invoke). Read more
Source§

fn platform_brightness(&self) -> Brightness

The platform’s light/dark preference (Flutter PlatformDispatcher.platformBrightness). Read more
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 windowing_owner(&self) -> Option<Rc<dyn WindowingOwner>>

The host’s window maker, for an app that opens windows of its own. None, the default, where the implicit view is the only one there can be: mobile and the web.
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 activate_system_cursor(&self, device: i64, kind: SystemMouseCursorKind)

Shows a system cursor for a pointing device (Flutter’s activateSystemCursor message on SystemChannels.mouseCursor). Read more
Source§

fn restoration_get(&self) -> Option<RestorationUpdate>

The restoration data the host kept for this application (the get message of Flutter’s SystemChannels.restoration). Read more
Source§

fn restoration_put(&self, data: RestorationMap)

Hands the host the current restoration data (the put message of Flutter’s SystemChannels.restoration), which keeps it until the operating system asks for it. Read more

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,