pub struct NavigationToolbar {
pub key: Option<KeyRef>,
pub leading: Option<WidgetRef>,
pub middle: Option<WidgetRef>,
pub trailing: Option<WidgetRef>,
pub center_middle: bool,
pub middle_spacing: f64,
}Expand description
NavigationToolbar is a layout helper to position 3 widgets or groups of
widgets along a horizontal axis that’s sensible for an application’s
navigation bar such as in Material Design and in iOS.
The leading and trailing widgets occupy the edges of
the widget with reasonable size constraints while the middle widget
occupies the remaining space in either a center aligned or start aligned fashion.
Either directly use the themed app bars such as the iOS CupertinoNavigationBar or wrap
this widget with more theming specifications for your own custom app bar.
Fields§
§key: Option<KeyRef>§leading: Option<WidgetRef>Widget to place at the start of the horizontal toolbar.
middle: Option<WidgetRef>Widget to place in the middle of the horizontal toolbar, occupying as much remaining space as possible.
trailing: Option<WidgetRef>Widget to place at the end of the horizontal toolbar.
center_middle: boolWhether to align the middle widget to the center of this widget or
next to the leading widget when false.
middle_spacing: f64The spacing around the middle widget on horizontal axis.
Defaults to K_MIDDLE_SPACING.
Implementations§
Sourcepub const K_MIDDLE_SPACING: f64 = 16.0
pub const K_MIDDLE_SPACING: f64 = 16.0
The default spacing around the middle widget in dp.
Sourcepub fn new() -> NavigationToolbar
pub fn new() -> NavigationToolbar
Creates a widget that lays out its children in a manner suitable for a toolbar; Dart’s named arguments are the setters.
Sourcepub fn key(self, key: KeyRef) -> NavigationToolbar
pub fn key(self, key: KeyRef) -> NavigationToolbar
Dart NavigationToolbar(key:).
Sourcepub fn leading<K>(self, leading: impl IntoWidget<K>) -> NavigationToolbar
pub fn leading<K>(self, leading: impl IntoWidget<K>) -> NavigationToolbar
Dart NavigationToolbar(leading:).
Sourcepub fn middle<K>(self, middle: impl IntoWidget<K>) -> NavigationToolbar
pub fn middle<K>(self, middle: impl IntoWidget<K>) -> NavigationToolbar
Dart NavigationToolbar(middle:).
Sourcepub fn trailing<K>(self, trailing: impl IntoWidget<K>) -> NavigationToolbar
pub fn trailing<K>(self, trailing: impl IntoWidget<K>) -> NavigationToolbar
Dart NavigationToolbar(trailing:).
Sourcepub fn center_middle(self, center_middle: bool) -> NavigationToolbar
pub fn center_middle(self, center_middle: bool) -> NavigationToolbar
Dart NavigationToolbar(centerMiddle:).
Sourcepub fn middle_spacing(self, middle_spacing: f64) -> NavigationToolbar
pub fn middle_spacing(self, middle_spacing: f64) -> NavigationToolbar
Dart NavigationToolbar(middleSpacing:).
Trait Implementations§
Source§fn default() -> NavigationToolbar
fn default() -> NavigationToolbar
Source§fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
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)
fn debug_check_constructor(&self)
Source§fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
this is PreferredSizeWidget: a widget that implements PreferredSizeWidget
answers with itself, which is what a parent asking an erased child for its preferred
size reads.Auto Trait Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.