ButtonStyle class
Defines the visual style properties for a Button.
Constructors
- ButtonStyle({Color foregroundColor = Color.white, Color backgroundColor = Color.blue, Color focusColor = Color.brightWhite, Color focusBackgroundColor = Color.brightBlue, Color disabledColor = Color.brightBlack, Color disabledBackgroundColor = Color.black, EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 2, vertical: 0), bool bold = false})
-
Creates a ButtonStyle with customizable colors, padding, and bold flag.
const
Properties
- backgroundColor → Color
-
The background color in the normal state.
final
- bold → bool
-
Whether the button text is rendered bold.
final
- disabledBackgroundColor → Color
-
The background color when the button is disabled.
final
- disabledColor → Color
-
The text color when the button is disabled.
final
- focusBackgroundColor → Color
-
The background color when the button has focus.
final
- focusColor → Color
-
The text color when the button has focus.
final
- foregroundColor → Color
-
The text color in the normal (unfocused, enabled) state.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- padding → EdgeInsets
-
Padding around the button label.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{Color? foregroundColor, Color? backgroundColor, Color? focusColor, Color? focusBackgroundColor, Color? disabledColor, Color? disabledBackgroundColor, EdgeInsets? padding, bool? bold}) → ButtonStyle - Creates a copy of this style with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited