ContainedButton.small constructor

ContainedButton.small({
  1. Key? key,
  2. Widget? child,
  3. String? text,
  4. WidgetStateProperty<Color?>? color,
  5. GBButtonGradient? gradient,
  6. bool uppercase = true,
  7. bool busy = false,
  8. Color? busyColor,
  9. required VoidCallback? onPressed,
  10. Duration? loadingDebounce,
  11. BorderRadius? borderRadius,
  12. bool guessTextColor = true,
  13. EdgeInsets? padding,
  14. bool disabled = false,
  15. double minWidth = 164,
  16. ButtonStyle? style,
})

Implementation

factory ContainedButton.small({
  Key? key,
  Widget? child,
  String? text,
  WidgetStateProperty<Color?>? color,
  GBButtonGradient? gradient,
  bool uppercase = true,
  bool busy = false,
  Color? busyColor,
  required VoidCallback? onPressed,
  Duration? loadingDebounce,
  BorderRadius? borderRadius,
  bool guessTextColor = true,
  EdgeInsets? padding,
  bool disabled = false,
  double minWidth = 164,
  ButtonStyle? style,
}) {
  assert(child == null || text == null);
  return ContainedButton(
    key: key,
    color: color,
    gradient: gradient,
    minWidth: minWidth,
    height: 48,
    onPressed: onPressed,
    busy: busy,
    busyColor: busyColor,
    loadingDebounce: loadingDebounce,
    borderRadius: borderRadius,
    guessTextColor: guessTextColor,
    padding: padding,
    disabled: disabled,
    style: style,
    child:
        child ?? Text(uppercase ? (text ?? '').toUpperCase() : (text ?? '')),
  );
}