ButtonGroupData class
Data class defining border radius multipliers for grouped buttons.
ButtonGroupData specifies which corners of a button should have reduced border radius when part of a ButtonGroup. Values of 0.0 remove the radius entirely (for internal buttons), while 1.0 preserves the full radius (for end buttons).
This class uses directional values (start/end) to support RTL layouts properly. The static constants provide common configurations for different positions within a button group.
Example:
// First button in horizontal group - preserve left radius, remove right
ButtonGroupData.horizontal(end: 0.0)
// Middle button - remove all radius
ButtonGroupData.zero
// Last button in horizontal group - remove left radius, preserve right
ButtonGroupData.horizontal(start: 0.0)
Constructors
- ButtonGroupData({required double topStartValue, required double topEndValue, required double bottomStartValue, required double bottomEndValue})
-
Creates button group data with individual corner multipliers.
const
- ButtonGroupData.all(double value)
-
Creates group data with the same multiplier for all corners.
const
- ButtonGroupData.horizontal({double start = 1.0, double end = 1.0})
-
Creates horizontal group data with start and end multipliers.
const
- ButtonGroupData.horizontalIndex(int index, int length)
-
Creates group data for a button at
indexin a horizontal group oflengthbuttons.factory - ButtonGroupData.vertical({double top = 1.0, double bottom = 1.0})
-
Creates vertical group data with top and bottom multipliers.
const
- ButtonGroupData.verticalIndex(int index, int length)
-
Creates group data for a button at
indexin a vertical group oflengthbuttons.factory
Properties
- bottomEndValue → double
-
Border radius multiplier for bottom-end corner (0.0 to 1.0).
final
- bottomStartValue → double
-
Border radius multiplier for bottom-start corner (0.0 to 1.0).
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- topEndValue → double
-
Border radius multiplier for top-end corner (0.0 to 1.0).
final
- topStartValue → double
-
Border radius multiplier for top-start corner (0.0 to 1.0).
final
Methods
-
applyToBorderRadius(
BorderRadiusGeometry borderRadius, TextDirection textDirection) → BorderRadiusGeometry - Applies corner multipliers to a border radius.
-
applyToButtonGroupData(
ButtonGroupData other) → ButtonGroupData - Combines this group data with another by multiplying corresponding corner values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- horizontalEnd → const ButtonGroupData
- Horizontal end position - no start radius, full end radius.
- horizontalStart → const ButtonGroupData
- Horizontal start position - full start radius, no end radius.
- none → const ButtonGroupData
- No modification - full border radius on all corners.
- verticalBottom → const ButtonGroupData
- Vertical bottom position - no top radius, full bottom radius.
- verticalTop → const ButtonGroupData
- Vertical top position - full top radius, no bottom radius.
- zero → const ButtonGroupData
- Zero radius - removes border radius from all corners.