Skip to main content

TestViewHost

Struct TestViewHost 

Source
pub struct TestViewHost { /* private fields */ }
Expand description

A view’s host that records what the view asks of the system, as flutter_test’s TestTextInput logs the text input channel and its tests log SystemChannels.mouseCursor, SystemChannels.navigation’s setFrameworkHandlesBack and SystemChannels.platform’s overlay style.

Implementations§

Source§

impl TestViewHost

Source

pub fn cursors(&self) -> Vec<(i64, SystemMouseCursorKind)>

Each cursor shown over the view, with the device it was shown for, oldest first.

Source

pub fn focus_requests(&self) -> Vec<(ViewFocusState, ViewFocusDirection)>

Each focus change requested for the view, oldest first.

Source

pub fn text_input_calls(&self) -> Vec<TextInputCall>

What the view’s text input was asked, oldest first.

Source

pub fn framework_handles_back(&self) -> Vec<bool>

Each value the framework said of whether it handles back in the view (ViewHost::set_framework_handles_back), oldest first.

Source

pub fn overlay_styles(&self) -> Vec<SystemUiOverlayStyle>

Each style set for the system’s bars over the view (SystemBars::set_overlay_style), oldest first.

Source

pub fn bars_shown(&self) -> Vec<BarsShown>

Each time the system’s bars over the view were hidden or shown again (SystemBars::hide, SystemBars::show), oldest first.

Trait Implementations§

Source§

impl Default for TestViewHost

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl SystemBars for TestViewHost

Source§

fn set_overlay_style(&self, style: &SystemUiOverlayStyle)

Styles the bars (Flutter SystemChrome.setSystemUIOverlayStyle).
Source§

fn hide(&self, behavior: SystemBarsBehavior)

Hides the bars until show; what a swipe from a screen’s edge does meanwhile is behavior’s. Flutter’s SystemUiMode.immersive is hide(ShowBarsBySwipe), immersiveSticky is hide(ShowTransientBarsBySwipe).
Source§

fn show(&self)

Shows the bars again, drawn over the view: how a view starts. Flutter’s SystemUiMode.edgeToEdge.
Source§

impl ViewHost for TestViewHost

Source§

fn text_input(&self) -> Option<&dyn TextInputHost>

The input methods that edit text in this view; none where it takes no text.
Source§

fn activate_system_cursor(&self, device: i64, kind: SystemMouseCursorKind)

Shows a system cursor for a pointing device over this view: Flutter’s activateSystemCursor message on SystemChannels.mouseCursor. A host with one cursor for every view shows it wherever the pointer is.
Source§

fn request_focus_change( &self, state: ViewFocusState, direction: ViewFocusDirection, )

Flutter’s PlatformDispatcher.requestViewFocusChange for this view: asks the system to move the input focus to it, or away from it. A host whose system has no focus to move ignores it. The view’s window is not brought forward: HostWindow::activate does that.
Source§

fn set_framework_handles_back(&self, handles: bool)

Informs the host of whether or not the framework will handle back events in this view (Flutter SystemNavigator.setFrameworkHandlesBack): whether a navigator in the view has a route to pop. A host that hears Back only while the view said it handles it follows it, as Android’s predictive back does, or one whose view cannot answer a press on the spot. Read more
Source§

fn system_bars(&self) -> Option<&dyn SystemBars>

The system’s bars over this view, the status bar and on Android the navigation bar; None where the system draws none over it, as over a desktop’s window.
Source§

fn view_size_changed(&self, size: Size)

The view’s frames are size physical pixels large from now on, a size other than the view had: the size it laid itself out at within loose constraints (ViewMetrics::physical_constraints), which is its content’s. Heard with the first frame of that size, before that frame shows, so whatever shows the view can take the size with the picture: Flutter’s Windows embedder tells a view’s sizing delegate so (FlutterWindowsViewSizingDelegate::DidUpdateViewSize), and Chromium a widget’s delegate in auto-resize mode (RenderWidgetHostDelegate::ResizeDueToAutoResize). 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,