RadioGroupDecoration class
This class is applied to a RadioGroup to define the style and design of it.
{@tool snippet}
This sample shows the creation of a radio group with some additional spacing and amber colored buttons and blue text labels.
RadioGroupController myController = RadioGroupController();
RadioGroup(
controller: myController,
values: ["Choice1", "Choice2", "Choice3"],
decoration: RadioGroupDecoration(
spacing: 10.0,
labelStyle: TextStyle(
color: Colors.blue,
),
activeColor: Colors.amber,
),
)
{@end-tool}
Constructors
-
RadioGroupDecoration({double spacing = 0.0, double runSpacing = 0.0, MainAxisAlignment verticalAlignment = MainAxisAlignment.start, WrapAlignment horizontalAlignment = WrapAlignment.center, TextStyle? labelStyle, bool toggleable = false, Color? activeColor, WidgetStateProperty<
Color?> ? fillColor, Color? focusColor, Color? hoverColor, WidgetStateProperty<Color?> ? overlayColor, double? splashRadius}) -
Creates a decoration object that can be applied to a RadioGroup to
define that radio group's style and design.
const
Properties
- activeColor → Color?
-
The color to use when this radio button is selected.
final
-
fillColor
→ WidgetStateProperty<
Color?> ? -
The color that fills the radio button, in all
MaterialStates
.final - focusColor → Color?
-
The color for the radio's
Material
when it has the input focus.final - hashCode → int
-
The hash code for this object.
no setterinherited
- horizontalAlignment → WrapAlignment
-
Where the radio buttons should be aligned in the horizontal direction.
final
- hoverColor → Color?
-
The color for the radio's
Material
when a pointer is hovering over it.final - labelStyle → TextStyle?
-
The text style for the radio buttons labels.
final
-
overlayColor
→ WidgetStateProperty<
Color?> ? -
The color for the checkbox's
Material
.final - runSpacing → double
-
The amount of space between each row if the radio group is horizontal and
needs to wrap to multiple rows.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → double
-
The amount of space between each button.
final
- splashRadius → double?
-
The splash radius of the circular
Material
ink response.final - toggleable → bool
-
If
true
the selected radio button may be pressed again resulting in it deselecting and no buttons in the group being selected.final - verticalAlignment → MainAxisAlignment
-
How the radio buttons should be aligned horizontally in a vertical list.
final
Methods
-
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