solid static method
Solid Button
Implementation
static Widget solid({
UKitButtonBuilder? as,
String? label,
Color? labelColor,
TextStyle? labelStyle,
required Function onPressed,
Color? bgColor,
double? borderRadius,
double? elevation,
double? widthFactor,
Widget? icon,
Color? shadowColor,
bool loading = false,
}) {
return FractionallySizedBox(
alignment: Alignment.centerLeft,
widthFactor: UKitUtils.getDouble(as, as?.widthFactor, widthFactor, 1.0),
child: TextButton(
onPressed: onPressed as void Function(),
style: ButtonStyle(
padding: WidgetStateProperty.all<EdgeInsets>(
as?.padding ?? const EdgeInsets.all(15.0),
),
overlayColor: WidgetStateProperty.resolveWith<Color?>(
(Set<WidgetState> states) {
if (states.contains(WidgetState.focused)) return Colors.black12;
if (states.contains(WidgetState.hovered)) return Colors.black12;
if (states.contains(WidgetState.pressed)) return Colors.black12;
return null; // Defer to the widget's default.
},
),
backgroundColor: WidgetStateProperty.resolveWith<Color>(
(Set<WidgetState> states) {
return UKitUtils.getColor(as, as?.bgColor, bgColor, Colors.blue);
},
),
elevation: WidgetStateProperty.resolveWith<double>(
(Set<WidgetState> states) {
return UKitUtils.getDouble(as, as?.elevation, elevation, 1.0);
},
),
shadowColor: WidgetStateProperty.resolveWith<Color>(
(Set<WidgetState> states) {
return UKitUtils.getColor(as, as?.shadowColor, shadowColor, Colors.black);
},
),
shape: WidgetStateProperty.all<OutlinedBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
UKitUtils.getDouble(as, as?.borderRadius, borderRadius, 0.0),
),
),
),
),
child: loading ? UKitButtonLoading(as, labelColor) : UKitButtonContent(as, label, labelColor, labelStyle, icon),
),
);
}