solid static method

Widget solid({
  1. UIButtonDefaults? as,
  2. String? label,
  3. Color? labelColor,
  4. required Function onPressed,
  5. Color? bgColor,
  6. double? borderRadius,
  7. double? elevation,
  8. double? widthFactor,
  9. Widget? icon,
  10. Color? shadowColor,
})

Outlined Button

Implementation

static Widget solid({
  UIButtonDefaults? as,
  String? label,
  Color? labelColor,
  required Function onPressed,
  Color? bgColor,
  double? borderRadius,
  double? elevation,
  double? widthFactor,
  Widget? icon,
  Color? shadowColor,
}) {
  return FractionallySizedBox(
    alignment: Alignment.centerLeft,
    widthFactor: UIUtils.getDouble(as, as?.widthFactor, widthFactor, 1.0),
    child: TextButton(
      child: UIButtonContent(as, label, labelColor, icon),
      onPressed: onPressed as void Function(),
      style: ButtonStyle(
        padding: MaterialStateProperty.all<EdgeInsets>(
          as?.padding ?? EdgeInsets.all(15.0),
        ),
        overlayColor: MaterialStateProperty.resolveWith<Color?>(
          (Set<MaterialState> states) {
            if (states.contains(MaterialState.focused)) return Colors.black12;
            if (states.contains(MaterialState.hovered)) return Colors.black12;
            if (states.contains(MaterialState.pressed)) return Colors.black12;
            return null; // Defer to the widget's default.
          },
        ),
        backgroundColor: MaterialStateProperty.resolveWith<Color>(
          (Set<MaterialState> states) {
            return UIUtils.getColor(as, as?.bgColor, bgColor, Colors.blue);
          },
        ),
        elevation: MaterialStateProperty.resolveWith<double>(
          (Set<MaterialState> states) {
            return UIUtils.getDouble(as, as?.elevation, elevation, 1.0);
          },
        ),
        shadowColor: MaterialStateProperty.resolveWith<Color>(
          (Set<MaterialState> states) {
            return UIUtils.getColor(as, as?.shadowColor, shadowColor, Colors.black);
          },
        ),
        shape: MaterialStateProperty.all<OutlinedBorder>(
          RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(
              UIUtils.getDouble(as, as?.borderRadius, borderRadius, 0.0),
            ),
          ),
        ),
      ),
    ),
  );
}