pub struct InertPlatform;Expand description
Platform for hand-pumped tests.
Trait Implementations§
Source§impl Platform for InertPlatform
impl Platform for InertPlatform
Source§fn target_platform(&self) -> TargetPlatform
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)
fn request_frame(&self)
Requests one isolate frame at the host’s next appropriate opportunity.
Source§fn implicit_view(&self) -> Option<ViewRef>
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
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>
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
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>
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)
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
fn default_route_name(&self) -> String
The route the application was started with (Flutter
PlatformDispatcher.defaultRouteName). Read moreSource§fn set_application_switcher_description(
&self,
description: &ApplicationSwitcherDescription,
)
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)
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)
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)
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>
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
fn clipboard_has_strings(&self) -> bool
Whether the clipboard contains string data (Flutter’s
Clipboard.hasStrings);
the default answers false.Whether this host can show a system-rendered context menu (Flutter
PlatformDispatcher.supportsShowingSystemContextMenu). Read moreShows the system context menu (Flutter’s
ContextMenu.showSystemContextMenu). Read moreHides the system context menu (Flutter’s
ContextMenu.hideSystemContextMenu). Read moreShows
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 moreSource§fn search_web(&self, text: &str)
fn search_web(&self, text: &str)
Searches the web for the given text (Flutter’s
SearchWeb.invoke). Read moreShares the given text (Flutter’s
Share.invoke). Read moreSource§fn platform_brightness(&self) -> Brightness
fn platform_brightness(&self) -> Brightness
The platform’s light/dark preference (Flutter
PlatformDispatcher.platformBrightness). Read moreSource§fn request_view_focus_change(
&self,
view_id: ViewId,
state: ViewFocusState,
direction: ViewFocusDirection,
)
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>>
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>>
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)
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 moreSource§fn restoration_get(&self) -> Option<RestorationUpdate>
fn restoration_get(&self) -> Option<RestorationUpdate>
The restoration data the host kept for this application (the
get message of
Flutter’s SystemChannels.restoration). Read moreSource§fn restoration_put(&self, data: RestorationMap)
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 moreAuto Trait Implementations§
impl Freeze for InertPlatform
impl RefUnwindSafe for InertPlatform
impl Send for InertPlatform
impl Sync for InertPlatform
impl Unpin for InertPlatform
impl UnsafeUnpin for InertPlatform
impl UnwindSafe for InertPlatform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more