DefaultTextButtonStyle constructor
DefaultTextButtonStyle({})
Implementation
factory DefaultTextButtonStyle(
{Color? color,
Color? backgroundColor,
Color? focusedAndSelectedColor,
Color? focusedAndSelectedBackgroundColor,
Color? disabledColor,
Color? disabledBackgroundColor,
Color? borderColor,
double radius = 6.0,
double width = 0,
EdgeInsetsGeometry? padding}) {
return DefaultTextButtonStyle._(
TextButton.styleFrom(
padding: padding,
primary: color,
onSurface: color,
backgroundColor: backgroundColor,
shape: RoundedRectangleBorder(
side: width <= 0 || borderColor == Colors.transparent
? BorderSide.none
: BorderSide(color: borderColor ?? Colors.black, width: width),
borderRadius: radius <= 0
? BorderRadius.zero
: BorderRadius.all(
Radius.circular(radius),
),
),
)
.addState(
foregroundColor: focusedAndSelectedColor,
backgroundColor: focusedAndSelectedBackgroundColor,
)
.addState(
foregroundColor: disabledColor,
backgroundColor: disabledBackgroundColor,
state: {
MaterialState.disabled,
},
),
);
}