pub struct MenuButtonThemeData {
pub style: Option<ButtonStyle>,
}Expand description
A ButtonStyle theme that overrides the default appearance of
SubmenuButtons and MenuItemButtons.
Descendant widgets obtain the current MenuButtonThemeData object
using MenuButtonTheme::of.
A MenuButtonThemeData is often specified as part of the
overall Theme with ThemeData::menu_button_theme.
The style’s properties override MenuItemButton’s and SubmenuButton’s
default style, i.e. the ButtonStyle returned by
MenuItemButton::default_style_of and SubmenuButton::default_style_of. Only the
style’s non-null property values or resolved non-null
WidgetStateProperty values are used.
See also:
MenuButtonTheme, the theme which is configured with this class.MenuTheme, the theme used to configure the look of the menus these buttons reside in.MenuItemButton::default_style_ofandSubmenuButton::default_style_ofwhich return the defaultButtonStyles for menu buttons.MenuItemButton::style_fromandSubmenuButton::style_from, which converts simple values into aButtonStylethat’s consistent with their respective defaults.WidgetStateProperty::resolve, “resolve” a material state property to a simple value based on a set ofWidgetStates.ThemeData::menu_button_theme, which can be used to override the defaultButtonStyleforMenuItemButtons andSubmenuButtons below the overallTheme.MenuAnchor, a widget which hosts cascading menus.MenuBar, a widget which defines a menu bar of buttons hosting cascading menus.
Fields§
§style: Option<ButtonStyle>Overrides for SubmenuButton and MenuItemButton’s default style.
Non-null properties or non-null resolved WidgetStateProperty values
override the ButtonStyle returned by SubmenuButton::default_style_of or
MenuItemButton::default_style_of.
If style is null, then this theme doesn’t override anything.
Implementations§
Source§impl MenuButtonThemeData
impl MenuButtonThemeData
Sourcepub fn new() -> MenuButtonThemeData
pub fn new() -> MenuButtonThemeData
Creates a MenuButtonThemeData.
The style may be null.
Sourcepub fn style(self, style: ButtonStyle) -> MenuButtonThemeData
pub fn style(self, style: ButtonStyle) -> MenuButtonThemeData
Dart MenuButtonThemeData(style:).
Sourcepub fn lerp(
a: Option<&MenuButtonThemeData>,
b: Option<&MenuButtonThemeData>,
t: f64,
) -> Option<MenuButtonThemeData>
pub fn lerp( a: Option<&MenuButtonThemeData>, b: Option<&MenuButtonThemeData>, t: f64, ) -> Option<MenuButtonThemeData>
Linearly interpolate between two menu button themes.
Trait Implementations§
Source§impl Clone for MenuButtonThemeData
impl Clone for MenuButtonThemeData
Source§impl Debug for MenuButtonThemeData
impl Debug for MenuButtonThemeData
Source§impl Default for MenuButtonThemeData
impl Default for MenuButtonThemeData
Source§impl Diagnosticable for MenuButtonThemeData
impl Diagnosticable for MenuButtonThemeData
Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Object.runtimeType as diagnostics print it: the last segment of
the Rust type path, without generic arguments.Source§fn identity_hash(&self) -> u64
fn identity_hash(&self) -> u64
Object.hashCode as diagnostics print it: the object’s address.Source§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
Source§fn to_diagnostics_node(&self) -> DiagnosticableNode
fn to_diagnostics_node(&self) -> DiagnosticableNode
DiagnosticsNode::to_string_deep.Source§fn to_diagnostics_node_with(
&self,
name: Option<String>,
style: Option<DiagnosticsTreeStyle>,
) -> DiagnosticableNode
fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode
toDiagnosticsNode(name:, style:).Source§fn to_string(&self) -> String
fn to_string(&self) -> String
toString: a single-line description with properties and no
children. Read moreSource§fn to_string_at(&self, min_level: DiagnosticLevel) -> String
fn to_string_at(&self, min_level: DiagnosticLevel) -> String
toString(minLevel:).