Skip to main content

Shell

Struct Shell 

Source
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

Source

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.

Source

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.

Source

pub fn cell(&self) -> &Rc<AppCell>

Trait Implementations§

Source§

impl EmbedderClient for Shell

Source§

fn view_added(&mut self, id: ViewId)

The framework hears which view came, then “metrics changed”, as _addView invokes it.

Source§

fn view_removed(&mut self, id: ViewId)

The framework hears which view went, then “metrics changed”, as _removeView invokes it.

Source§

fn screens_changed(&mut self)

“Metrics changed”, as _updateDisplays invokes it.

Source§

fn request_app_exit(&mut self, reply: AppExitReply)

The binding’s answer goes to reply at the checkpoint of the call in which the observers decide: this push’s own when they answer at once.

Source§

fn app_lifecycle_state_changed(&mut self, state: AppLifecycleState)

On resumed or inactive, every view is marked to present and asked for a frame before the bindings hear the state: a view that did not change while the app was away would otherwise present nothing.

Source§

fn frame(&mut self, views: &[ViewId], frame: Frame)

A screen refreshed at frame.elapsed: views are the views on it, in sight, that asked for a frame (Platform::request_frame) before the refresh began; one that asks during it is in the next. Read more
Source§

fn view_metrics_changed(&mut self, _id: ViewId)

Flutter’s window metrics event: something of id’s metrics changed, the screen it is on included.
Source§

fn view_focus_changed(&mut self, event: ViewFocusEvent)

Flutter PlatformDispatcher.onViewFocusChange.
Source§

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)

Flutter PlatformDispatcher.onPointerDataPacket.
Source§

fn key_data(&mut self, data: KeyData) -> bool

Flutter PlatformDispatcher.onKeyData. Read more
Source§

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 view_close_requested(&mut self, view: ViewId)

The user asked to close view: its window’s close button, or the system’s Close command. The host closes nothing itself; the application closes the window, through HostWindow::close, or keeps it open, such as until its user has chosen whether to save. Nothing waits for an answer. Read more
Source§

fn window_changed(&mut self, view: ViewId)

The window of view was minimized or restored, became occluded or shown, or moved, and its HostWindow already answers how it is now: as Flutter’s window controllers notify their listeners at the platform’s word. A resize is reported as a metrics change alone (view_metrics_changed). The default drops it.
Source§

fn view_request_failed(&mut self, request: RequestId, error: ViewError)

A request for a view (crate::Platform::request_view) got no view: the host could not make its window. The default drops it.
Source§

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)

Flutter PlatformDispatcher.onLocaleChanged: the host’s locale list changed, and Platform::locales already answers the new one.
Source§

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 wake(&mut self, elapsed: Duration)

The wake asked for through Dispatcher::wake_at or Dispatcher::wake_now. Read more
Source§

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)

Flutter TextInputClient.performAction. The default drops it.
Source§

fn text_input_closed(&mut self, _view: ViewId)

Flutter TextInputClient.connectionClosed. The default drops it.
Source§

fn system_context_menu_hidden(&mut self)

Flutter SystemContextMenuClient.handleSystemHide. The default drops it.
Source§

fn custom_context_menu_action(&mut self, callback_id: &str)

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> 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>