BadButton.two constructor

BadButton.two({
  1. Key? key,
  2. double? width,
  3. double? height,
  4. EdgeInsets? margin,
  5. EdgeInsets? padding,
  6. BoxConstraints? constraints,
  7. Border? border,
  8. double borderRadius = 0,
  9. Color? fill,
  10. Alignment? alignment = Alignment.center,
  11. MainAxisSize mainAxisSize = MainAxisSize.min,
  12. required void onPressed(),
  13. required Widget left,
  14. required Widget right,
  15. double gap = 0.0,
})

In most case, child will be a Row contains two widget with a gap. (e.g. Prefix + Text, Text + Suffix)

Implementation

BadButton.two({
  super.key,
  this.width,
  this.height,
  this.margin,
  this.padding,
  this.constraints,
  this.border,
  this.borderRadius = 0,
  this.fill,
  this.alignment = Alignment.center,
  MainAxisSize mainAxisSize = MainAxisSize.min,
  required this.onPressed,
  required Widget left,
  required Widget right,
  double gap = 0.0,
}) : child = Row(
        mainAxisSize: mainAxisSize,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [left, if (gap != 0) SizedBox(width: gap), right],
      );