CustomButton.text constructor

const CustomButton.text({
  1. Key? key,
  2. required String? text,
  3. required VoidCallback onPressed,
  4. Color? color,
})

Creates a text button with the specified text and onPressed callback

The color parameter can be used to override the default button color.

Example:

CustomButton.text(
  text: 'Continue',
  onPressed: () => Navigator.of(context).push(...),
  color: Theme.of(context).primaryColor,
)

Implementation

const CustomButton.text({
  super.key,
  required this.text,
  required this.onPressed,
  this.color,
})  : type = CustomButtonType.text,
      icon = null;