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
impl TestViewHost
Sourcepub fn cursors(&self) -> Vec<(i64, SystemMouseCursorKind)>
pub fn cursors(&self) -> Vec<(i64, SystemMouseCursorKind)>
Each cursor shown over the view, with the device it was shown for, oldest first.
Sourcepub fn focus_requests(&self) -> Vec<(ViewFocusState, ViewFocusDirection)>
pub fn focus_requests(&self) -> Vec<(ViewFocusState, ViewFocusDirection)>
Each focus change requested for the view, oldest first.
Sourcepub fn text_input_calls(&self) -> Vec<TextInputCall>
pub fn text_input_calls(&self) -> Vec<TextInputCall>
What the view’s text input was asked, oldest first.
Sourcepub fn framework_handles_back(&self) -> Vec<bool>
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.
Sourcepub fn overlay_styles(&self) -> Vec<SystemUiOverlayStyle>
pub fn overlay_styles(&self) -> Vec<SystemUiOverlayStyle>
Each style set for the system’s bars over the view (SystemBars::set_overlay_style), oldest
first.
Sourcepub fn bars_shown(&self) -> Vec<BarsShown>
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
impl Default for TestViewHost
Source§impl SystemBars for TestViewHost
impl SystemBars for TestViewHost
Source§fn set_overlay_style(&self, style: &SystemUiOverlayStyle)
fn set_overlay_style(&self, style: &SystemUiOverlayStyle)
SystemChrome.setSystemUIOverlayStyle).Source§fn hide(&self, behavior: SystemBarsBehavior)
fn hide(&self, behavior: SystemBarsBehavior)
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§impl ViewHost for TestViewHost
impl ViewHost for TestViewHost
Source§fn text_input(&self) -> Option<&dyn TextInputHost>
fn text_input(&self) -> Option<&dyn TextInputHost>
Source§fn activate_system_cursor(&self, device: i64, kind: SystemMouseCursorKind)
fn activate_system_cursor(&self, device: i64, kind: SystemMouseCursorKind)
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,
)
fn request_focus_change( &self, state: ViewFocusState, direction: ViewFocusDirection, )
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)
fn set_framework_handles_back(&self, handles: bool)
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 moreSource§fn system_bars(&self) -> Option<&dyn SystemBars>
fn system_bars(&self) -> Option<&dyn SystemBars>
None
where the system draws none over it, as over a desktop’s window.Source§fn view_size_changed(&self, size: Size)
fn view_size_changed(&self, size: Size)
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