styleFrom static method

SegmentedControlStyle styleFrom({
  1. BorderRadius? borderRadius,
  2. Color? borderColor,
  3. double? borderWidth,
  4. Color? backgroundColor,
  5. EdgeInsets? padding,
  6. double? elevation,
  7. Color? indicatorColor,
  8. EdgeInsets? indicatorMargin,
  9. double? indicatorElevation,
  10. TextStyle? unselectedTextStyle,
  11. TextStyle? selectedTextStyle,
})

A helper method to create a SegmentedControlStyle.

Implementation

static SegmentedControlStyle styleFrom({
  BorderRadius? borderRadius,
  Color? borderColor,
  double? borderWidth,
  Color? backgroundColor,
  EdgeInsets? padding,
  double? elevation,
  Color? indicatorColor,
  EdgeInsets? indicatorMargin,
  double? indicatorElevation,
  TextStyle? unselectedTextStyle,
  TextStyle? selectedTextStyle,
}) {
  return SegmentedControlStyle(
    borderRadius: borderRadius,
    borderColor: borderColor,
    borderWidth: borderWidth ?? 1.0,
    backgroundColor: backgroundColor,
    padding:
        padding ?? const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
    elevation: elevation ?? 0.0,
    indicatorColor: indicatorColor,
    indicatorMargin: indicatorMargin,
    indicatorElevation: indicatorElevation ?? 0.0,
    unselectedTextStyle: unselectedTextStyle,
    selectedTextStyle: selectedTextStyle,
  );
}