pub struct AppBarTheme {
pub key: Option<KeyRef>,
/* private fields */
}Expand description
Defines default property values for descendant AppBar widgets.
Descendant widgets obtain the current AppBarThemeData object with
AppBarTheme::of. Instances of AppBarThemeData can be customized
with AppBarThemeData::copy_with.
Typically an AppBarThemeData is specified as part of the overall Theme with
ThemeData::app_bar_theme.
All AppBarTheme properties are null by default. When null, the
AppBar constructor provides defaults.
Dart’s AppBarTheme constructor takes either the properties or a data;
here the properties are the with_* setters and with_data the other,
and each setter that breaks Dart’s constructor assert (a data together with any property)
fails in a debug build. The getters are methods, as Dart’s, hence the with_ prefix.
See also:
ThemeData, which describes the overall theme information for the application.
Fields§
§key: Option<KeyRef>Implementations§
Source§impl AppBarTheme
impl AppBarTheme
Sourcepub fn new() -> AppBarTheme
pub fn new() -> AppBarTheme
Creates a theme that can be used for ThemeData::app_bar_theme.
Sourcepub fn key(self, key: KeyRef) -> AppBarTheme
pub fn key(self, key: KeyRef) -> AppBarTheme
Dart AppBarTheme(key:).
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> AppBarTheme
pub fn child<K>(self, child: impl IntoWidget<K>) -> AppBarTheme
Dart AppBarTheme(child:); the default is an empty SizedBox.
Sourcepub fn with_data(self, data: AppBarThemeData) -> AppBarTheme
pub fn with_data(self, data: AppBarThemeData) -> AppBarTheme
Dart AppBarTheme(data:).
Sourcepub fn with_color(self, color: Color) -> AppBarTheme
👎Deprecated: Use backgroundColor instead. This feature was deprecated after v3.33.0-0.2.pre.
pub fn with_color(self, color: Color) -> AppBarTheme
Use backgroundColor instead. This feature was deprecated after v3.33.0-0.2.pre.
Dart AppBarTheme(color:): the same as with_background_color.
Sourcepub fn with_background_color(self, background_color: Color) -> AppBarTheme
pub fn with_background_color(self, background_color: Color) -> AppBarTheme
Dart AppBarTheme(backgroundColor:).
Sourcepub fn with_foreground_color(self, foreground_color: Color) -> AppBarTheme
pub fn with_foreground_color(self, foreground_color: Color) -> AppBarTheme
Dart AppBarTheme(foregroundColor:).
Sourcepub fn with_elevation(self, elevation: f64) -> AppBarTheme
pub fn with_elevation(self, elevation: f64) -> AppBarTheme
Dart AppBarTheme(elevation:).
Sourcepub fn with_scrolled_under_elevation(
self,
scrolled_under_elevation: f64,
) -> AppBarTheme
pub fn with_scrolled_under_elevation( self, scrolled_under_elevation: f64, ) -> AppBarTheme
Dart AppBarTheme(scrolledUnderElevation:).
Sourcepub fn with_shadow_color(self, shadow_color: Color) -> AppBarTheme
pub fn with_shadow_color(self, shadow_color: Color) -> AppBarTheme
Dart AppBarTheme(shadowColor:).
Sourcepub fn with_surface_tint_color(self, surface_tint_color: Color) -> AppBarTheme
pub fn with_surface_tint_color(self, surface_tint_color: Color) -> AppBarTheme
Dart AppBarTheme(surfaceTintColor:).
Sourcepub fn with_shape(self, shape: impl Into<ShapeBorderRef>) -> AppBarTheme
pub fn with_shape(self, shape: impl Into<ShapeBorderRef>) -> AppBarTheme
Dart AppBarTheme(shape:).
Sourcepub fn with_icon_theme(self, icon_theme: IconThemeData) -> AppBarTheme
pub fn with_icon_theme(self, icon_theme: IconThemeData) -> AppBarTheme
Dart AppBarTheme(iconTheme:).
Sourcepub fn with_actions_icon_theme(
self,
actions_icon_theme: IconThemeData,
) -> AppBarTheme
pub fn with_actions_icon_theme( self, actions_icon_theme: IconThemeData, ) -> AppBarTheme
Dart AppBarTheme(actionsIconTheme:).
Sourcepub fn with_center_title(self, center_title: bool) -> AppBarTheme
pub fn with_center_title(self, center_title: bool) -> AppBarTheme
Dart AppBarTheme(centerTitle:).
Sourcepub fn with_title_spacing(self, title_spacing: f64) -> AppBarTheme
pub fn with_title_spacing(self, title_spacing: f64) -> AppBarTheme
Dart AppBarTheme(titleSpacing:).
Sourcepub fn with_leading_width(self, leading_width: f64) -> AppBarTheme
pub fn with_leading_width(self, leading_width: f64) -> AppBarTheme
Dart AppBarTheme(leadingWidth:).
Sourcepub fn with_toolbar_height(self, toolbar_height: f64) -> AppBarTheme
pub fn with_toolbar_height(self, toolbar_height: f64) -> AppBarTheme
Dart AppBarTheme(toolbarHeight:).
Sourcepub fn with_toolbar_text_style(
self,
toolbar_text_style: TextStyle,
) -> AppBarTheme
pub fn with_toolbar_text_style( self, toolbar_text_style: TextStyle, ) -> AppBarTheme
Dart AppBarTheme(toolbarTextStyle:).
Sourcepub fn with_title_text_style(self, title_text_style: TextStyle) -> AppBarTheme
pub fn with_title_text_style(self, title_text_style: TextStyle) -> AppBarTheme
Dart AppBarTheme(titleTextStyle:).
Sourcepub fn with_system_overlay_style(
self,
system_overlay_style: SystemUiOverlayStyle,
) -> AppBarTheme
pub fn with_system_overlay_style( self, system_overlay_style: SystemUiOverlayStyle, ) -> AppBarTheme
Dart AppBarTheme(systemOverlayStyle:).
Sourcepub fn with_actions_padding(
self,
actions_padding: impl Into<EdgeInsetsGeometry>,
) -> AppBarTheme
pub fn with_actions_padding( self, actions_padding: impl Into<EdgeInsetsGeometry>, ) -> AppBarTheme
Dart AppBarTheme(actionsPadding:).
Sourcepub fn background_color(&self) -> Option<Color>
pub fn background_color(&self) -> Option<Color>
Overrides the default value of AppBar::background_color in all
descendant AppBar widgets.
See also:
foreground_color, which overrides the default value ofAppBar::foreground_colorin all descendantAppBarwidgets.
Sourcepub fn foreground_color(&self) -> Option<Color>
pub fn foreground_color(&self) -> Option<Color>
Overrides the default value of AppBar::foreground_color in all
descendant AppBar widgets.
See also:
background_color, which overrides the default value ofAppBar::background_colorin all descendantAppBarwidgets.
Sourcepub fn elevation(&self) -> Option<f64>
pub fn elevation(&self) -> Option<f64>
Overrides the default value of AppBar::elevation in all
descendant AppBar widgets.
Sourcepub fn scrolled_under_elevation(&self) -> Option<f64>
pub fn scrolled_under_elevation(&self) -> Option<f64>
Overrides the default value of AppBar::scrolled_under_elevation in all
descendant AppBar widgets.
Sourcepub fn shadow_color(&self) -> Option<Color>
pub fn shadow_color(&self) -> Option<Color>
Overrides the default value of AppBar::shadow_color in all
descendant AppBar widgets.
Sourcepub fn surface_tint_color(&self) -> Option<Color>
pub fn surface_tint_color(&self) -> Option<Color>
Overrides the default value of AppBar::surface_tint_color in all
descendant AppBar widgets.
Sourcepub fn shape(&self) -> Option<&ShapeBorderRef>
pub fn shape(&self) -> Option<&ShapeBorderRef>
Overrides the default value of AppBar::shape in all
descendant AppBar widgets.
Sourcepub fn icon_theme(&self) -> Option<&IconThemeData>
pub fn icon_theme(&self) -> Option<&IconThemeData>
Overrides the default value of AppBar::icon_theme in all
descendant AppBar widgets.
See also:
actions_icon_theme, which overrides the default value ofAppBar::actions_icon_themein all descendantAppBarwidgets.foreground_color, which overrides the default valueAppBar::foreground_colorin all descendantAppBarwidgets.
Sourcepub fn actions_icon_theme(&self) -> Option<&IconThemeData>
pub fn actions_icon_theme(&self) -> Option<&IconThemeData>
Overrides the default value of AppBar::actions_icon_theme in all
descendant AppBar widgets.
See also:
icon_theme, which overrides the default value ofAppBar::icon_themein all descendantAppBarwidgets.foreground_color, which overrides the default valueAppBar::foreground_colorin all descendantAppBarwidgets.
Sourcepub fn center_title(&self) -> Option<bool>
pub fn center_title(&self) -> Option<bool>
Overrides the default value of AppBar::center_title
property in all descendant AppBar widgets.
Sourcepub fn title_spacing(&self) -> Option<f64>
pub fn title_spacing(&self) -> Option<f64>
Overrides the default value of the obsolete AppBar::title_spacing
property in all descendant AppBar widgets.
If null, AppBar uses default value of NavigationToolbar::K_MIDDLE_SPACING.
Sourcepub fn leading_width(&self) -> Option<f64>
pub fn leading_width(&self) -> Option<f64>
Overrides the default value of the AppBar::leading_width
property in all descendant AppBar widgets.
Sourcepub fn toolbar_height(&self) -> Option<f64>
pub fn toolbar_height(&self) -> Option<f64>
Overrides the default value of the AppBar::toolbar_height
property in all descendant AppBar widgets.
See also:
AppBar::preferred_height_for, which computes the overall height of an AppBar widget, taking this value into account.
Sourcepub fn toolbar_text_style(&self) -> Option<&TextStyle>
pub fn toolbar_text_style(&self) -> Option<&TextStyle>
Overrides the default value of the obsolete AppBar::toolbar_text_style
property in all descendant AppBar widgets.
See also:
title_text_style, which overrides the default ofAppBar::title_text_stylein all descendantAppBarwidgets.
Sourcepub fn title_text_style(&self) -> Option<&TextStyle>
pub fn title_text_style(&self) -> Option<&TextStyle>
Overrides the default value of AppBar::title_text_style
property in all descendant AppBar widgets.
See also:
toolbar_text_style, which overrides the default ofAppBar::toolbar_text_stylein all descendantAppBarwidgets.
Sourcepub fn system_overlay_style(&self) -> Option<SystemUiOverlayStyle>
pub fn system_overlay_style(&self) -> Option<SystemUiOverlayStyle>
Overrides the default value of AppBar::system_overlay_style
property in all descendant AppBar widgets.
Sourcepub fn actions_padding(&self) -> Option<EdgeInsetsGeometry>
pub fn actions_padding(&self) -> Option<EdgeInsetsGeometry>
Overrides the default value of AppBar::actions_padding
property in all descendant AppBar widgets.
Sourcepub fn data(&self) -> AppBarThemeData
pub fn data(&self) -> AppBarThemeData
The properties used for all descendant AppBar widgets.
Sourcepub fn copy_with(&self) -> AppBarTheme
pub fn copy_with(&self) -> AppBarTheme
Creates a copy of this object with the given fields replaced with the new values.
This method is obsolete and will be deprecated in a future release:
please use the AppBarThemeData::copy_with method instead.
Dart’s named arguments are the fluent setters on the copy
(theme.copy_with().with_elevation(2.0)). As in Dart, the copy carries neither the
key nor the child, and holds the properties, never a data.
Sourcepub fn of(app: &mut App, context: BuildContext) -> AppBarThemeData
pub fn of(app: &mut App, context: BuildContext) -> AppBarThemeData
Retrieves the AppBarThemeData from the closest ancestor AppBarTheme.
If there is no enclosing AppBarTheme widget, then
ThemeData::app_bar_theme is used.
Typical usage is as follows:
let theme = AppBarTheme::of(app, context);Sourcepub fn lerp(
a: Option<&AppBarTheme>,
b: Option<&AppBarTheme>,
t: f64,
) -> AppBarTheme
pub fn lerp( a: Option<&AppBarTheme>, b: Option<&AppBarTheme>, t: f64, ) -> AppBarTheme
Linearly interpolate between two AppBar themes.
{@macro dart.ui.shadow.lerp}
Trait Implementations§
Source§impl Clone for AppBarTheme
impl Clone for AppBarTheme
Source§impl Debug for AppBarTheme
impl Debug for AppBarTheme
Source§impl Default for AppBarTheme
impl Default for AppBarTheme
Source§fn default() -> AppBarTheme
fn default() -> AppBarTheme
Source§impl From<AppBarTheme> for AppBarThemeData
ThemeData(appBarTheme:) takes Dart’s Object?, either an AppBarThemeData or an
AppBarTheme whose data is used.
impl From<AppBarTheme> for AppBarThemeData
ThemeData(appBarTheme:) takes Dart’s Object?, either an AppBarThemeData or an
AppBarTheme whose data is used.
Source§fn from(app_bar_theme: AppBarTheme) -> AppBarThemeData
fn from(app_bar_theme: AppBarTheme) -> AppBarThemeData
Source§impl InheritedTheme for AppBarTheme
impl InheritedTheme for AppBarTheme
Source§impl InheritedWidget for AppBarTheme
impl InheritedWidget for AppBarTheme
Source§fn update_should_notify(&self, old_widget: &AppBarTheme) -> bool
fn update_should_notify(&self, old_widget: &AppBarTheme) -> bool
Source§fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
this is InheritedTheme: an inherited widget that is an InheritedTheme
answers with itself, which is what InheritedTheme::capture collects.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.Auto Trait Implementations§
impl !RefUnwindSafe for AppBarTheme
impl !Send for AppBarTheme
impl !Sync for AppBarTheme
impl !UnwindSafe for AppBarTheme
impl Forget for AppBarTheme
impl Freeze for AppBarThemewhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn ShapeBorder> is !null: Freeze,
PhantomData<RcInner<dyn ShapeBorder>>: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Shadow>: Freeze,
*const RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const RcInner<Paint> is !null: Freeze,
PhantomData<RcInner<Paint>>: Freeze,
PhantomData<FontFeature>: Freeze,
PhantomData<FontVariation>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for AppBarTheme
impl Unpin for AppBarThemewhere
Rc<dyn Key>: Unpin,
Rc<dyn ShapeBorder>: Unpin,
&'static dyn ColorExtension: Unpin,
Rc<dyn ColorExtension>: Unpin,
*const u8 is !null: Unpin,
Rc<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>: Unpin,
Rc<Paint>: Unpin,
Rc<dyn Widget>: Unpin,
impl UnsafeUnpin for AppBarThemewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn ShapeBorder> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ShapeBorder>>: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Shadow>: UnsafeUnpin,
*const RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const RcInner<Paint> is !null: UnsafeUnpin,
PhantomData<RcInner<Paint>>: UnsafeUnpin,
PhantomData<FontFeature>: UnsafeUnpin,
PhantomData<FontVariation>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.