PrimaryButton constructor

const PrimaryButton({
  1. Key? key,
  2. required String label,
  3. required dynamic onTap(),
  4. Widget? icon,
  5. Color? backgroundColor,
  6. Color? textColor,
  7. BorderSide? borderSide,
  8. Size? fixedSize,
  9. double? borderRadius,
  10. bool isDisabled = false,
  11. Function? onDisabledTap,
  12. IconAlignment? iconAlignment,
  13. bool hapticFeedback = true,
  14. bool isExpanded = true,
  15. double fontSize = 16,
})

This button uses TextTheme.labelMedium for the text style.

It has a default height of 60 and a default border radius of 260.

The button has a default background color of colorScheme.primary.

The button has a default text color of colorScheme.onPrimary.

The button has a default border radius of 260.

The button has a default border side of BorderSide.none.

The button has a default fixed size of Size.fromHeight(60).

The button has a default icon alignment of IconAlignment.left.

The button has a default haptic feedback of true.

The button has a default isExpanded of true.

The button has a default isDisabled of false.

The button has a default font size of 16.

Implementation

const PrimaryButton({
  super.key,
  required this.label,
  required this.onTap,
  this.icon,
  this.backgroundColor,
  this.textColor,
  this.borderSide,
  this.fixedSize,
  this.borderRadius,
  this.isDisabled = false,
  this.onDisabledTap,
  this.iconAlignment,
  this.hapticFeedback = true,
  this.isExpanded = true,
  this.fontSize = 16,
});