pub struct Shell { /* private fields */ }Expand description
Host-facing isolate: the AppCell plus the methods the embedder pushes.
Every push is one call into the app: the App is borrowed for the binding call and
released before the cell’s checkpoint, where the microtasks and futures the event queued
run.
Implementations§
Source§impl Shell
impl Shell
Sourcepub fn new(platform: PlatformRef, setup: impl FnOnce(&mut App)) -> Shell
pub fn new(platform: PlatformRef, setup: impl FnOnce(&mut App)) -> Shell
Builds the heap from platform, then runs application setup.
Setup (later widgets run_app) requests the first frame when it
installs work that needs one.
Sourcepub fn app(&self) -> RefMut<'_, App>
pub fn app(&self) -> RefMut<'_, App>
The App, borrowed until the guard drops. A host that needs the whole thing, a borrow
and then the checkpoint, takes cell.
pub fn cell(&self) -> &Rc<AppCell>
Trait Implementations§
Source§impl EmbedderClient for Shell
impl EmbedderClient for Shell
Source§fn request_app_exit(&mut self) -> AppExitFuture
fn request_app_exit(&mut self) -> AppExitFuture
The binding’s task, whose checkpoint is this push’s own: an answer the observers gave at once is ready when the call returns.
fn frame(&mut self, frame: Frame)
Source§fn view_added(&mut self, _id: ViewId)
fn view_added(&mut self, _id: ViewId)
A view arrived after launch: opened by the app, or given by the system. The views that
exist at launch are in
Platform::views when the app starts, and none of them is
reported here.fn view_metrics_changed(&mut self, _id: ViewId)
Source§fn view_removed(&mut self, _id: ViewId)
fn view_removed(&mut self, _id: ViewId)
A view is gone; the app keeps running.
Source§fn view_focus_changed(&mut self, event: ViewFocusEvent)
fn view_focus_changed(&mut self, event: ViewFocusEvent)
Flutter
PlatformDispatcher.onViewFocusChange.Source§fn drop_data(&mut self, data: DropData)
fn drop_data(&mut self, data: DropData)
Files dragged from outside the application entered, moved over, were dropped on or
left a view. No dart:ui hook; the default drops it.
Source§fn pointer_data_packet(&mut self, packet: PointerDataPacket)
fn pointer_data_packet(&mut self, packet: PointerDataPacket)
Flutter
PlatformDispatcher.onPointerDataPacket.Source§fn pop_route(&mut self) -> bool
fn pop_route(&mut self) -> bool
The user asked to go back: Android’s back button or back gesture, and whatever a
later host maps onto the same idea. Read more
Source§fn app_lifecycle_state_changed(&mut self, state: AppLifecycleState)
fn app_lifecycle_state_changed(&mut self, state: AppLifecycleState)
The application entered
state: its views were shown, hidden, focused or unfocused, or
the system put it in the background or brought it back. The host sends the state it is
in, and the framework fills in the states between, as Flutter’s ServicesBinding does. Read moreSource§fn platform_brightness_changed(&mut self)
fn platform_brightness_changed(&mut self)
Flutter
PlatformDispatcher.onPlatformBrightnessChanged: the host’s light or dark
preference changed, and Platform::platform_brightness already answers the new one.Source§fn locales_changed(&mut self)
fn locales_changed(&mut self)
Flutter
PlatformDispatcher.onLocaleChanged: the host’s locale list changed, and
Platform::locales already answers the new one.Source§fn system_fonts_changed(&mut self)
fn system_fonts_changed(&mut self)
Flutter
PlatformDispatcher.onSystemFontsChanged: the host registered faces the
framework did not have when text last laid out.Source§fn text_input_editing_value(&mut self, _view: ViewId, value: TextEditingValue)
fn text_input_editing_value(&mut self, _view: ViewId, value: TextEditingValue)
Flutter
TextInputClient.updateEditingValue. The default drops it.Source§fn text_input_action(&mut self, _view: ViewId, action: TextInputAction)
fn text_input_action(&mut self, _view: ViewId, action: TextInputAction)
Flutter
TextInputClient.performAction. The default drops it.Source§fn text_input_closed(&mut self, _view: ViewId)
fn text_input_closed(&mut self, _view: ViewId)
Flutter
TextInputClient.connectionClosed. The default drops it.Flutter
SystemContextMenuClient.handleSystemHide. The default drops it.Flutter
SystemContextMenuClient.handleCustomContextMenuAction. The default drops it.Auto Trait Implementations§
impl !RefUnwindSafe for Shell
impl !Send for Shell
impl !Sync for Shell
impl !UnwindSafe for Shell
impl Freeze for Shell
impl Unpin for Shell
impl UnsafeUnpin for Shell
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