NxPrimaryButton constructor

const NxPrimaryButton({
  1. required String text,
  2. required VoidCallback? onPressed,
  3. Key? key,
  4. TextStyle? buttonTextStyle,
  5. EdgeInsetsGeometry? margin = const EdgeInsets.symmetric(vertical: 16),
  6. double? buttonWidth = double.maxFinite,
  7. double? buttonHeight,
  8. ButtonStyle? buttonStyle,
})

Creates a primary button with filled style.

  • text - The button's label text
  • onPressed - Callback when button is pressed, null disables the button
  • buttonTextStyle - Optional text style for the label
  • margin - Space around the button, defaults to vertical margin of 16
  • buttonWidth - Button width, defaults to full width
  • buttonHeight - Optional fixed height for the button
  • buttonStyle - Optional complete style override

Implementation

const NxPrimaryButton({
  required this.text,
  required this.onPressed,
  super.key,
  this.buttonTextStyle,
  this.margin = const EdgeInsets.symmetric(vertical: 16),
  this.buttonWidth = double.maxFinite,
  this.buttonHeight,
  this.buttonStyle,
});