pub struct ElevatedButtonTheme {
pub key: Option<KeyRef>,
pub data: ElevatedButtonThemeData,
pub child: WidgetRef,
}Expand description
Overrides the default ButtonStyle of its ElevatedButton descendants.
See also:
ElevatedButtonThemeData, which is used to configure this theme.ElevatedButton::default_style_of, which returns the defaultButtonStylefor elevated buttons.ElevatedButton::style_from, which converts simple values into aButtonStylethat’s consistent withElevatedButton’s defaults.ThemeData::elevated_button_theme, which can be used to override the defaultButtonStyleforElevatedButtons below the overallTheme.
Fields§
§key: Option<KeyRef>§data: ElevatedButtonThemeDataThe configuration of this theme.
child: WidgetRefImplementations§
Source§impl ElevatedButtonTheme
impl ElevatedButtonTheme
Sourcepub fn new<K>(
data: ElevatedButtonThemeData,
child: impl IntoWidget<K>,
) -> ElevatedButtonTheme
pub fn new<K>( data: ElevatedButtonThemeData, child: impl IntoWidget<K>, ) -> ElevatedButtonTheme
Create a ElevatedButtonTheme.
Sourcepub fn key(self, key: KeyRef) -> ElevatedButtonTheme
pub fn key(self, key: KeyRef) -> ElevatedButtonTheme
Dart ElevatedButtonTheme(key:).
Sourcepub fn of(app: &mut App, context: BuildContext) -> ElevatedButtonThemeData
pub fn of(app: &mut App, context: BuildContext) -> ElevatedButtonThemeData
Retrieves the ElevatedButtonThemeData from the closest ancestor
ElevatedButtonTheme.
If there is no enclosing ElevatedButtonTheme widget, then
ThemeData::elevated_button_theme is used.
The returned ElevatedButtonThemeData::variant is the value specified by
that theme, which can be null even when an ancestor specifies a variant.
Use variant_of to get the variant that applies at the given
context.
Typical usage is as follows:
let theme = ElevatedButtonTheme::of(app, context);Sourcepub fn variant_of(app: &mut App, context: BuildContext) -> StyleVariant
pub fn variant_of(app: &mut App, context: BuildContext) -> StyleVariant
Returns the StyleVariant that ElevatedButtons use at the given
context.
The closest enclosing ElevatedButtonTheme whose
ElevatedButtonThemeData::variant is non-null determines the variant, so
an ElevatedButtonTheme that doesn’t specify a variant inherits it from
its ancestors. If none of the enclosing ElevatedButtonThemes specify a
variant, the variant of ThemeData::elevated_button_theme is used. If that
is also null, StyleVariant::Material3 is returned.
Typical usage is as follows:
let variant = ElevatedButtonTheme::variant_of(app, context);Trait Implementations§
Source§impl Debug for ElevatedButtonTheme
impl Debug for ElevatedButtonTheme
Source§impl InheritedTheme for ElevatedButtonTheme
impl InheritedTheme for ElevatedButtonTheme
Source§impl InheritedWidget for ElevatedButtonTheme
impl InheritedWidget for ElevatedButtonTheme
Source§fn update_should_notify(&self, old_widget: &ElevatedButtonTheme) -> bool
fn update_should_notify(&self, old_widget: &ElevatedButtonTheme) -> 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 ElevatedButtonTheme
impl !Send for ElevatedButtonTheme
impl !Sync for ElevatedButtonTheme
impl !UnwindSafe for ElevatedButtonTheme
impl Forget for ElevatedButtonTheme
impl Freeze for ElevatedButtonThemewhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<TextStyle>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<TextStyle>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<f64>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<f64>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<Size>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Size>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<BorderSide>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<BorderSide>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>>: Freeze,
*const RcInner<dyn InteractiveInkFeatureFactory> is !null: Freeze,
PhantomData<RcInner<dyn InteractiveInkFeatureFactory>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>>>: Freeze,
*const (): Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for ElevatedButtonTheme
impl Unpin for ElevatedButtonThemewhere
Rc<dyn Key>: Unpin,
Rc<dyn WidgetStateProperty<Option<TextStyle>>>: Unpin,
Rc<dyn WidgetStateProperty<Option<Color>>>: Unpin,
Rc<dyn WidgetStateProperty<Option<f64>>>: Unpin,
Rc<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>>: Unpin,
Rc<dyn WidgetStateProperty<Option<Size>>>: Unpin,
Rc<dyn WidgetStateProperty<Option<BorderSide>>>: Unpin,
Rc<dyn WidgetStateProperty<Option<OutlinedBorderRef>>>: Unpin,
Rc<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>: Unpin,
Rc<dyn InteractiveInkFeatureFactory>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>>: Unpin,
*const (): Unpin,
Rc<dyn Widget>: Unpin,
impl UnsafeUnpin for ElevatedButtonThemewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<TextStyle>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<TextStyle>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<f64>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<f64>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<Size>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Size>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<BorderSide>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<BorderSide>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>>: UnsafeUnpin,
*const RcInner<dyn InteractiveInkFeatureFactory> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn InteractiveInkFeatureFactory>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const (): 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<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.