Skip to main content

Scaffold

Struct Scaffold 

Source
pub struct Scaffold {
Show 28 fields pub key: Option<KeyRef>, pub extend_body: bool, pub drawer_barrier_dismissible: bool, pub extend_body_behind_app_bar: bool, pub app_bar: Option<PreferredSizeWidgetRef>, pub body: Option<WidgetRef>, pub floating_action_button: Option<WidgetRef>, pub floating_action_button_location: Option<FloatingActionButtonLocationRef>, pub floating_action_button_animator: Option<FloatingActionButtonAnimatorRef>, pub persistent_footer_buttons: Option<Vec<WidgetRef>>, pub persistent_footer_alignment: AlignmentDirectional, pub persistent_footer_decoration: Option<BoxDecoration>, pub drawer: Option<WidgetRef>, pub on_drawer_changed: Option<DrawerCallback>, pub end_drawer: Option<WidgetRef>, pub on_end_drawer_changed: Option<DrawerCallback>, pub drawer_scrim_color: Option<Color>, pub bottom_sheet_scrim_builder: BottomSheetScrimBuilder, pub background_color: Option<Color>, pub bottom_navigation_bar: Option<WidgetRef>, pub bottom_sheet: Option<WidgetRef>, pub resize_to_avoid_bottom_inset: Option<bool>, pub primary: bool, pub drawer_drag_start_behavior: DragStartBehavior, pub drawer_edge_drag_width: Option<f64>, pub drawer_enable_open_drag_gesture: bool, pub end_drawer_enable_open_drag_gesture: bool, pub restoration_id: Option<String>,
}
Expand description

Implements the basic Material Design visual layout structure.

This class provides APIs for showing drawers and bottom sheets.

To display a persistent bottom sheet, obtain the ScaffoldState for the current BuildContext via Scaffold::of and use the ScaffoldState::show_bottom_sheet function.

§Scaffold layout, the keyboard, and display “notches”

The scaffold will expand to fill the available space. That usually means that it will occupy its entire window or device screen. When the device’s keyboard appears the Scaffold’s ancestor MediaQuery widget’s MediaQueryData.viewInsets changes and the Scaffold will be rebuilt. By default the scaffold’s body is resized to make room for the keyboard. To prevent the resize set resize_to_avoid_bottom_inset to false. In either case the focused widget will be scrolled into view if it’s within a scrollable container.

The MediaQueryData.padding value defines areas that might not be completely visible, like the display “notch” on the iPhone X. The scaffold’s body is not inset by this padding value although an appBar or bottom_navigation_bar will typically cause the body to avoid the padding. The SafeArea widget can be used within the scaffold’s body to avoid areas like display notches.

§Floating action button with a draggable scrollable bottom sheet

If Scaffold::bottom_sheet is a DraggableScrollableSheet, Scaffold::floating_action_button is set, and the bottom sheet is dragged to cover greater than 70% of the Scaffold’s height, two things happen in parallel:

And as soon as the bottom sheet is dragged down to cover less than 70% of the Scaffold, the scrim disappears and Scaffold::floating_action_button animates back to its normal size.

§Troubleshooting

§Nested Scaffolds

The Scaffold is designed to be a top level container for a MaterialApp. This means that adding a Scaffold to each route on a Material app will provide the app with Material’s basic visual layout structure.

It is typically not necessary to nest Scaffolds. For example, in a tabbed UI, where the bottom_navigation_bar is a TabBar and the body is a TabBarView, you might be tempted to make each tab bar view a scaffold with a differently titled AppBar. Rather, it would be better to add a listener to the TabController that updates the AppBar.

Although there are some use cases, like a presentation app that shows embedded flutter content, where nested scaffolds are appropriate, it’s best to avoid nesting scaffolds.

See also:

  • AppBar, which is a horizontal bar typically shown at the top of an app using the appBar property.
  • BottomAppBar, which is a horizontal bar typically shown at the bottom of an app using the bottom_navigation_bar property.
  • FloatingActionButton, which is a circular button typically shown in the bottom right corner of the app using the floating_action_button property.
  • Drawer, which is a vertical panel that is typically displayed to the left of the body (and often hidden on phones) using the drawer property.
  • BottomNavigationBar, which is a horizontal array of buttons typically shown along the bottom of the app using the bottom_navigation_bar property.
  • BottomSheet, which is an overlay typically shown near the bottom of the app. A bottom sheet can either be persistent, in which case it is shown using the ScaffoldState::show_bottom_sheet method, or modal, in which case it is shown using the ShowModalBottomSheet function.

Fields§

§key: Option<KeyRef>§extend_body: bool

If true, and bottom_navigation_bar or persistent_footer_buttons is specified, then the body extends to the bottom of the Scaffold, instead of only extending to the top of the bottom_navigation_bar or the persistent_footer_buttons.

If true, a MediaQuery widget whose bottom padding matches the height of the bottom_navigation_bar will be added above the scaffold’s body.

This property is often useful when the bottom_navigation_bar has a non-rectangular shape, like CircularNotchedRectangle, which adds a FloatingActionButton sized notch to the top edge of the bar. In this case specifying extend_body: true ensures that scaffold’s body will be visible through the bottom navigation bar’s notch.

See also:

§drawer_barrier_dismissible: bool

Whether the drawer’s barrier can be dismissed by tapping on it. Defaults to true.

§extend_body_behind_app_bar: bool

If true, and an app_bar is specified, then the height of the body is extended to include the height of the app bar and the top of the body is aligned with the top of the app bar.

This is useful if the app bar’s AppBar.background_color is not completely opaque.

This property is false by default.

See also:

  • extend_body, which extends the height of the body to the bottom of the scaffold.
§app_bar: Option<PreferredSizeWidgetRef>

An app bar to display at the top of the scaffold.

§body: Option<WidgetRef>

The primary content of the scaffold.

Displayed below the appBar, above the bottom of the ambient MediaQuery’s MediaQueryData.viewInsets, and behind the floating_action_button and drawer. If resize_to_avoid_bottom_inset is false then the body is not resized when the onscreen keyboard appears, i.e. it is not inset by viewInsets.bottom.

The widget in the body of the scaffold is positioned at the top-left of the available space between the app bar and the bottom of the scaffold. To center this widget instead, consider putting it in a Center widget and having that be the body. To expand this widget instead, consider putting it in a SizedBox::expand.

If you have a column of widgets that should normally fit on the screen, but may overflow and would in such cases need to scroll, consider using a ListView as the body of the scaffold. This is also a good choice for the case where your body is a scrollable list.

§floating_action_button: Option<WidgetRef>

A button displayed floating above body, in the bottom right corner.

Typically a FloatingActionButton.

§floating_action_button_location: Option<FloatingActionButtonLocationRef>

Responsible for determining where the floating_action_button should go.

If null, the ScaffoldState will use the default location, <dyn FloatingActionButtonLocation>::end_float().

§floating_action_button_animator: Option<FloatingActionButtonAnimatorRef>

Animator to move the floating_action_button to a new floating_action_button_location.

If null, the ScaffoldState will use the default animator, <dyn FloatingActionButtonAnimator>::scaling().

§persistent_footer_buttons: Option<Vec<WidgetRef>>

A set of buttons that are displayed at the bottom of the scaffold.

Typically this is a list of TextButton widgets. These buttons are persistently visible, even if the body of the scaffold scrolls.

These widgets will be wrapped in an OverflowBar.

The persistent_footer_buttons are rendered above the bottom_navigation_bar but below the body.

§persistent_footer_alignment: AlignmentDirectional

The alignment of the persistent_footer_buttons inside the OverflowBar.

Defaults to AlignmentDirectional::CENTER_END.

§persistent_footer_decoration: Option<BoxDecoration>

Decoration for the container that holds the persistent_footer_buttons.

By default, this container has a top border with a width of 1.0, created by Divider::create_border_side.

See also:

§drawer: Option<WidgetRef>

A panel displayed to the side of the body, often hidden on mobile devices. Swipes in from either left-to-right (TextDirection::Ltr) or right-to-left (TextDirection::Rtl)

Typically a Drawer.

To open the drawer, use the ScaffoldState::open_drawer function.

To close the drawer, use either ScaffoldState::close_drawer, Navigator.pop or press the escape key on the keyboard.

§on_drawer_changed: Option<DrawerCallback>

Optional callback that is called when the Scaffold::drawer is opened or closed.

§end_drawer: Option<WidgetRef>

A panel displayed to the side of the body, often hidden on mobile devices. Swipes in from right-to-left (TextDirection::Ltr) or left-to-right (TextDirection::Rtl)

Typically a Drawer.

To open the drawer, use the ScaffoldState::open_end_drawer function.

To close the drawer, use either ScaffoldState::close_end_drawer, Navigator.pop or press the escape key on the keyboard.

§on_end_drawer_changed: Option<DrawerCallback>

Optional callback that is called when the Scaffold::end_drawer is opened or closed.

§drawer_scrim_color: Option<Color>

The color to use for the scrim that obscures primary content while a drawer is open.

If this is null, then DrawerThemeData.scrimColor is used. If that is also null, then it defaults to Colors.black54.

§bottom_sheet_scrim_builder: BottomSheetScrimBuilder

A builder for the widget that obscures the body when a draggable bottom_sheet covers most of the screen. Dart’s default is _defaultBottomSheetScrimBuilder.

§background_color: Option<Color>

The color of the Material widget that underlies the entire Scaffold.

The theme’s ThemeData.scaffoldBackgroundColor by default.

§bottom_navigation_bar: Option<WidgetRef>

A bottom navigation bar to display at the bottom of the scaffold.

Snack bars slide from underneath the bottom navigation bar while bottom sheets are stacked on top.

The bottom_navigation_bar is rendered below the persistent_footer_buttons and the body.

§bottom_sheet: Option<WidgetRef>

The persistent bottom sheet to display.

A persistent bottom sheet shows information that supplements the primary content of the app. A persistent bottom sheet remains visible even when the user interacts with other parts of the app.

A closely related widget is a modal bottom sheet, which is an alternative to a menu or a dialog and prevents the user from interacting with the rest of the app. Modal bottom sheets can be created and displayed with the ShowModalBottomSheet function.

Unlike the persistent bottom sheet displayed by ScaffoldState::show_bottom_sheet, this bottom sheet is not a LocalHistoryEntry and cannot be dismissed with the scaffold appbar’s back button.

If a persistent bottom sheet created with ScaffoldState::show_bottom_sheet is already visible, it must be closed before building the Scaffold with a new bottom_sheet.

The value of bottom_sheet can be any widget at all. It’s unlikely to actually be a BottomSheet, which is used by the implementations of ScaffoldState::show_bottom_sheet and ShowModalBottomSheet. Typically it’s a widget that includes Material.

§resize_to_avoid_bottom_inset: Option<bool>

If true the body and the scaffold’s floating widgets should size themselves to avoid the onscreen keyboard whose height is defined by the ambient MediaQuery’s MediaQueryData.viewInsets bottom property.

For example, if there is an onscreen keyboard displayed above the scaffold, the body can be resized to avoid overlapping the keyboard, which prevents widgets inside the body from being obscured by the keyboard.

Defaults to true.

§primary: bool

Whether this scaffold is being displayed at the top of the screen.

If true then the height of the appBar will be extended by the height of the screen’s status bar, i.e. the top padding for MediaQuery.

The default value of this property, like the default value of AppBar.primary, is true.

§drawer_drag_start_behavior: DragStartBehavior

Determines the way that drag start behavior is handled.

§drawer_edge_drag_width: Option<f64>

The width of the area within which a horizontal swipe will open the drawer.

By default, the value used is 20.0 added to the padding edge of MediaQuery.paddingOf(context) that corresponds to the surrounding TextDirection. This ensures that the drag area for notched devices is not obscured.

§drawer_enable_open_drag_gesture: bool

Determines if the Scaffold::drawer can be opened with a drag gesture on mobile.

On desktop platforms, the drawer is not draggable.

By default, the drag gesture is enabled on mobile.

§end_drawer_enable_open_drag_gesture: bool

Determines if the Scaffold::end_drawer can be opened with a gesture on mobile.

On desktop platforms, the drawer is not draggable.

By default, the drag gesture is enabled on mobile.

§restoration_id: Option<String>

Restoration ID to save and restore the state of the Scaffold.

If it is non-null, the scaffold will persist and restore whether the drawer and end_drawer was open or closed.

The state of this widget is persisted in a RestorationBucket claimed from the surrounding RestorationScope using the provided restoration ID.

Implementations§

Source§

impl Scaffold

Source

pub fn new() -> Scaffold

Creates a visual scaffold for Material Design widgets.

Source

pub fn key(self, key: KeyRef) -> Scaffold

Dart Scaffold(key:).

Source

pub fn app_bar(self, app_bar: PreferredSizeWidgetRef) -> Scaffold

Dart Scaffold(appBar:).

Source

pub fn body<K>(self, body: impl IntoWidget<K>) -> Scaffold

Dart Scaffold(body:).

Source

pub fn floating_action_button<K>( self, floating_action_button: impl IntoWidget<K>, ) -> Scaffold

Dart Scaffold(floatingActionButton:).

Source

pub fn floating_action_button_location( self, floating_action_button_location: FloatingActionButtonLocationRef, ) -> Scaffold

Dart Scaffold(floatingActionButtonLocation:).

Source

pub fn floating_action_button_animator( self, floating_action_button_animator: FloatingActionButtonAnimatorRef, ) -> Scaffold

Dart Scaffold(floatingActionButtonAnimator:).

Dart Scaffold(persistentFooterButtons:).

Dart Scaffold(persistentFooterAlignment:).

Dart Scaffold(persistentFooterDecoration:).

Source

pub fn drawer<K>(self, drawer: impl IntoWidget<K>) -> Scaffold

Dart Scaffold(drawer:).

Source

pub fn on_drawer_changed( self, on_drawer_changed: impl Fn(&mut App, bool) + 'static, ) -> Scaffold

Dart Scaffold(onDrawerChanged:).

Source

pub fn end_drawer<K>(self, end_drawer: impl IntoWidget<K>) -> Scaffold

Dart Scaffold(endDrawer:).

Source

pub fn on_end_drawer_changed( self, on_end_drawer_changed: impl Fn(&mut App, bool) + 'static, ) -> Scaffold

Dart Scaffold(onEndDrawerChanged:).

Source

pub fn bottom_navigation_bar<K>( self, bottom_navigation_bar: impl IntoWidget<K>, ) -> Scaffold

Dart Scaffold(bottomNavigationBar:).

Source

pub fn bottom_sheet<K>(self, bottom_sheet: impl IntoWidget<K>) -> Scaffold

Dart Scaffold(bottomSheet:).

Source

pub fn background_color(self, background_color: Color) -> Scaffold

Dart Scaffold(backgroundColor:).

Source

pub fn resize_to_avoid_bottom_inset( self, resize_to_avoid_bottom_inset: bool, ) -> Scaffold

Dart Scaffold(resizeToAvoidBottomInset:).

Source

pub fn primary(self, primary: bool) -> Scaffold

Dart Scaffold(primary:).

Source

pub fn drawer_drag_start_behavior( self, drawer_drag_start_behavior: DragStartBehavior, ) -> Scaffold

Dart Scaffold(drawerDragStartBehavior:).

Source

pub fn extend_body(self, extend_body: bool) -> Scaffold

Dart Scaffold(extendBody:).

Source

pub fn drawer_barrier_dismissible( self, drawer_barrier_dismissible: bool, ) -> Scaffold

Dart Scaffold(drawerBarrierDismissible:).

Source

pub fn extend_body_behind_app_bar( self, extend_body_behind_app_bar: bool, ) -> Scaffold

Dart Scaffold(extendBodyBehindAppBar:).

Source

pub fn drawer_scrim_color(self, drawer_scrim_color: Color) -> Scaffold

Dart Scaffold(drawerScrimColor:).

Source

pub fn bottom_sheet_scrim_builder( self, bottom_sheet_scrim_builder: impl Fn(&mut App, BuildContext, AnimationRef<f64>) -> Option<WidgetRef> + 'static, ) -> Scaffold

Dart Scaffold(bottomSheetScrimBuilder:).

Source

pub fn drawer_edge_drag_width(self, drawer_edge_drag_width: f64) -> Scaffold

Dart Scaffold(drawerEdgeDragWidth:).

Source

pub fn drawer_enable_open_drag_gesture( self, drawer_enable_open_drag_gesture: bool, ) -> Scaffold

Dart Scaffold(drawerEnableOpenDragGesture:).

Source

pub fn end_drawer_enable_open_drag_gesture( self, end_drawer_enable_open_drag_gesture: bool, ) -> Scaffold

Dart Scaffold(endDrawerEnableOpenDragGesture:).

Source

pub fn restoration_id(self, restoration_id: impl Into<String>) -> Scaffold

Dart Scaffold(restorationId:).

Source

pub fn of(app: &mut App, context: BuildContext) -> Handle<ScaffoldState>

Finds the ScaffoldState from the closest instance of this class that encloses the given context.

If no instance of this class encloses the given context, will cause an assert in debug mode, and throw an exception in release mode.

This method can be expensive (it walks the element tree).

Typical usage of the Scaffold::of function is to call it from within the build method of a child of a Scaffold.

When the Scaffold is actually created in the same build function, the context argument to the build function can’t be used to find the Scaffold (since it’s “above” the widget being returned in the widget tree). In such cases, the following technique with a Builder can be used to provide a new scope with a BuildContext that is “under” the Scaffold.

A more efficient solution is to split your build function into several widgets. This introduces a new context from which you can obtain the Scaffold. In this solution, you would have an outer widget that creates the Scaffold populated by instances of your new inner widgets, and then in these inner widgets you would use Scaffold::of.

A less elegant but more expedient solution is assign a GlobalKey to the Scaffold, then use the key.current_state method to obtain the ScaffoldState rather than using the Scaffold::of function.

If there is no Scaffold in scope, then this will throw an exception. To return null if there is no Scaffold, use maybe_of.

Source

pub fn maybe_of( app: &mut App, context: BuildContext, ) -> Option<Handle<ScaffoldState>>

Finds the ScaffoldState from the closest instance of this class that encloses the given context.

If no instance of this class encloses the given context, will return None. To throw an exception instead, use of instead of this function.

This method can be expensive (it walks the element tree).

See also:

  • of, a similar function to this one that throws if no instance encloses the given context. Also includes some sample code in its documentation.
Source

pub fn geometry_of( app: &mut App, context: BuildContext, ) -> Ref<ScaffoldGeometryNotifier>

Returns a notifier of the ScaffoldGeometry for the Scaffold that encloses the given context.

The geometry notifier is a ChangeNotifier whose value is the ScaffoldGeometry of the closest Scaffold ancestor of the given context; read it only while painting.

This method can be expensive (it walks the element tree).

For an example of using this, see the BottomAppBar, which uses it to paint a notch around the FloatingActionButton.

§Panics

If no Scaffold encloses context.

Source

pub fn has_drawer( app: &mut App, context: BuildContext, register_for_updates: bool, ) -> bool

Whether the Scaffold that most tightly encloses the given context has a drawer.

If this is being used during a build (for example to decide whether to show an “open drawer” button), set the register_for_updates argument to true. This will then set up an InheritedWidget relationship with the Scaffold so that the client widget gets rebuilt whenever the has_drawer value changes.

Dart’s default register_for_updates is true.

See also:

Trait Implementations§

Source§

impl Debug for Scaffold

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Scaffold

Source§

fn default() -> Scaffold

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

impl StatefulWidget for Scaffold

Source§

type State = ScaffoldState

The state this widget creates.
Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn create_state(&self) -> ScaffoldState

Creates the mutable state for this widget at a given location in the tree. Read more
Source§

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s debugFillProperties: the properties a dump shows for this widget, in Dart’s order. Dart’s Widget base only sets the dense tree style, which the framework does.
Source§

fn debug_check_constructor(&self)

Source§

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Source§

fn type_name(&self) -> &'static str

See Widget::type_name. A stateful form another widget kind becomes (an animated or status transition widget) names the widget it wraps.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Scaffold

§

impl !Send for Scaffold

§

impl !Sync for Scaffold

§

impl !UnwindSafe for Scaffold

§

impl Forget for Scaffold

§

impl Freeze for Scaffold
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze, *const RcInner<dyn FloatingActionButtonLocation> is !null: Freeze, PhantomData<RcInner<dyn FloatingActionButtonLocation>>: Freeze, *const RcInner<dyn FloatingActionButtonAnimator> is !null: Freeze, PhantomData<RcInner<dyn FloatingActionButtonAnimator>>: Freeze, *const u8 is !null: Freeze, PhantomData<Rc<dyn Widget>>: Freeze, &'static dyn ColorExtension: Freeze, *const RcInner<dyn ColorExtension> is !null: Freeze, PhantomData<RcInner<dyn ColorExtension>>: Freeze, *const RcInner<dyn BoxBorder> is !null: Freeze, PhantomData<RcInner<dyn BoxBorder>>: Freeze, PhantomData<BoxShadow>: Freeze, *const RcInner<dyn Gradient> is !null: Freeze, PhantomData<RcInner<dyn Gradient>>: Freeze, *const RcInner<dyn Fn(&mut App, bool)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, bool)>>: Freeze, *const RcInner<dyn Fn(&mut App, AnyElement, Retained<AnyAnimation<f64>>) -> Option<Rc<dyn Widget>>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Retained<AnyAnimation<f64>>) -> Option<Rc<dyn Widget>>>>: Freeze, PhantomData<u8>: Freeze,

§

impl Move for Scaffold

§

impl Unpin for Scaffold

§

impl UnsafeUnpin for Scaffold
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: UnsafeUnpin, *const RcInner<dyn FloatingActionButtonLocation> is !null: UnsafeUnpin, PhantomData<RcInner<dyn FloatingActionButtonLocation>>: UnsafeUnpin, *const RcInner<dyn FloatingActionButtonAnimator> is !null: UnsafeUnpin, PhantomData<RcInner<dyn FloatingActionButtonAnimator>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Rc<dyn Widget>>: UnsafeUnpin, &'static dyn ColorExtension: UnsafeUnpin, *const RcInner<dyn ColorExtension> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin, *const RcInner<dyn BoxBorder> is !null: UnsafeUnpin, PhantomData<RcInner<dyn BoxBorder>>: UnsafeUnpin, PhantomData<BoxShadow>: UnsafeUnpin, *const RcInner<dyn Gradient> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Gradient>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, bool)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, bool)>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement, Retained<AnyAnimation<f64>>) -> Option<Rc<dyn Widget>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Retained<AnyAnimation<f64>>) -> Option<Rc<dyn Widget>>>>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin,

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<W> IntoWidget<StatefulKind> for W
where W: StatefulWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
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>