BASFButton constructor

const BASFButton({
  1. Key? key,
  2. String? text,
  3. required VoidCallback? onPressed,
  4. required Color color,
  5. double? width = 48,
  6. bool expand = false,
  7. double? height = 48,
  8. EdgeInsets? padding,
  9. EdgeInsets? margin,
  10. IconData? leadingIcon,
  11. IconData? trailingIcon,
  12. IconData? iconOnly,
  13. bool negative = false,
})

Implementation

const BASFButton(
    {Key? key,
    this.text,
    required this.onPressed,
    required this.color,
    this.width = 48,
    this.expand = false,
    this.height = 48,
    this.padding,
    this.margin,
    this.leadingIcon,
    this.trailingIcon,
    this.iconOnly,
    this.negative = false})
    : assert(iconOnly != (text != null),
          'You need a text or the iconOnly with true, but only one.'),
      assert(
          (leadingIcon == null && trailingIcon == null) ||
              (((leadingIcon != null) || trailingIcon != null) &&
                  (text != null)),
          'You need a text to use leading or trailing icon'),
      assert(!((leadingIcon != null) && trailingIcon != null),
          'You can not use both leading and trailing icon'),
      super(key: key);