Skip to main content

AppBarTheme

Struct AppBarTheme 

Source
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

Source

pub fn new() -> AppBarTheme

Creates a theme that can be used for ThemeData::app_bar_theme.

Source

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

Dart AppBarTheme(key:).

Source

pub fn child<K>(self, child: impl IntoWidget<K>) -> AppBarTheme

Dart AppBarTheme(child:); the default is an empty SizedBox.

Source

pub fn with_data(self, data: AppBarThemeData) -> AppBarTheme

Dart AppBarTheme(data:).

Source

pub fn with_color(self, color: Color) -> AppBarTheme

👎Deprecated:

Use backgroundColor instead. This feature was deprecated after v3.33.0-0.2.pre.

Dart AppBarTheme(color:): the same as with_background_color.

Source

pub fn with_background_color(self, background_color: Color) -> AppBarTheme

Dart AppBarTheme(backgroundColor:).

Source

pub fn with_foreground_color(self, foreground_color: Color) -> AppBarTheme

Dart AppBarTheme(foregroundColor:).

Source

pub fn with_elevation(self, elevation: f64) -> AppBarTheme

Dart AppBarTheme(elevation:).

Source

pub fn with_scrolled_under_elevation( self, scrolled_under_elevation: f64, ) -> AppBarTheme

Dart AppBarTheme(scrolledUnderElevation:).

Source

pub fn with_shadow_color(self, shadow_color: Color) -> AppBarTheme

Dart AppBarTheme(shadowColor:).

Source

pub fn with_surface_tint_color(self, surface_tint_color: Color) -> AppBarTheme

Dart AppBarTheme(surfaceTintColor:).

Source

pub fn with_shape(self, shape: impl Into<ShapeBorderRef>) -> AppBarTheme

Dart AppBarTheme(shape:).

Source

pub fn with_icon_theme(self, icon_theme: IconThemeData) -> AppBarTheme

Dart AppBarTheme(iconTheme:).

Source

pub fn with_actions_icon_theme( self, actions_icon_theme: IconThemeData, ) -> AppBarTheme

Dart AppBarTheme(actionsIconTheme:).

Source

pub fn with_center_title(self, center_title: bool) -> AppBarTheme

Dart AppBarTheme(centerTitle:).

Source

pub fn with_title_spacing(self, title_spacing: f64) -> AppBarTheme

Dart AppBarTheme(titleSpacing:).

Source

pub fn with_leading_width(self, leading_width: f64) -> AppBarTheme

Dart AppBarTheme(leadingWidth:).

Source

pub fn with_toolbar_height(self, toolbar_height: f64) -> AppBarTheme

Dart AppBarTheme(toolbarHeight:).

Source

pub fn with_toolbar_text_style( self, toolbar_text_style: TextStyle, ) -> AppBarTheme

Dart AppBarTheme(toolbarTextStyle:).

Source

pub fn with_title_text_style(self, title_text_style: TextStyle) -> AppBarTheme

Dart AppBarTheme(titleTextStyle:).

Source

pub fn with_system_overlay_style( self, system_overlay_style: SystemUiOverlayStyle, ) -> AppBarTheme

Dart AppBarTheme(systemOverlayStyle:).

Source

pub fn with_actions_padding( self, actions_padding: impl Into<EdgeInsetsGeometry>, ) -> AppBarTheme

Dart AppBarTheme(actionsPadding:).

Source

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 of AppBar::foreground_color in all descendant AppBar widgets.
Source

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 of AppBar::background_color in all descendant AppBar widgets.
Source

pub fn elevation(&self) -> Option<f64>

Overrides the default value of AppBar::elevation in all descendant AppBar widgets.

Source

pub fn scrolled_under_elevation(&self) -> Option<f64>

Overrides the default value of AppBar::scrolled_under_elevation in all descendant AppBar widgets.

Source

pub fn shadow_color(&self) -> Option<Color>

Overrides the default value of AppBar::shadow_color in all descendant AppBar widgets.

Source

pub fn surface_tint_color(&self) -> Option<Color>

Overrides the default value of AppBar::surface_tint_color in all descendant AppBar widgets.

Source

pub fn shape(&self) -> Option<&ShapeBorderRef>

Overrides the default value of AppBar::shape in all descendant AppBar widgets.

Source

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 of AppBar::actions_icon_theme in all descendant AppBar widgets.
  • foreground_color, which overrides the default value AppBar::foreground_color in all descendant AppBar widgets.
Source

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 of AppBar::icon_theme in all descendant AppBar widgets.
  • foreground_color, which overrides the default value AppBar::foreground_color in all descendant AppBar widgets.
Source

pub fn center_title(&self) -> Option<bool>

Overrides the default value of AppBar::center_title property in all descendant AppBar widgets.

Source

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.

Source

pub fn leading_width(&self) -> Option<f64>

Overrides the default value of the AppBar::leading_width property in all descendant AppBar widgets.

Source

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.
Source

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 of AppBar::title_text_style in all descendant AppBar widgets.
Source

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 of AppBar::toolbar_text_style in all descendant AppBar widgets.
Source

pub fn system_overlay_style(&self) -> Option<SystemUiOverlayStyle>

Overrides the default value of AppBar::system_overlay_style property in all descendant AppBar widgets.

Source

pub fn actions_padding(&self) -> Option<EdgeInsetsGeometry>

Overrides the default value of AppBar::actions_padding property in all descendant AppBar widgets.

Source

pub fn data(&self) -> AppBarThemeData

The properties used for all descendant AppBar widgets.

Source

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.

Source

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);
Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppBarTheme

Source§

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

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

impl Default for AppBarTheme

Source§

fn default() -> AppBarTheme

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

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

Converts to this type from the input type.
Source§

impl InheritedTheme for AppBarTheme

Source§

fn wrap( &self, _app: &mut App, _context: BuildContext, child: WidgetRef, ) -> WidgetRef

Return a copy of this inherited theme with the specified child. Read more
Source§

impl InheritedWidget for AppBarTheme

Source§

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

Source§

fn child(&self) -> &WidgetRef

The widget below this widget in the tree.
Source§

fn update_should_notify(&self, old_widget: &AppBarTheme) -> bool

Whether the framework should notify widgets that inherit from this widget. Read more
Source§

fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>

Dart’s 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, )

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)

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 AppBarTheme
where *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 AppBarTheme
where 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 AppBarTheme

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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<InheritedKind> for W
where W: InheritedWidget,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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>