AppButton constructor

const AppButton({
  1. Key? key,
  2. double height = 50.0,
  3. double width = double.infinity,
  4. Color backgroundColor = AppColors.primaryColor,
  5. required String text,
  6. TextStyle textStyle = const TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.white),
  7. Color foregroundColor = Colors.white,
  8. double borderRadius = 8.0,
  9. VoidCallback? onPressed,
})

Implementation

const AppButton({
  Key? key,
  this.height = 50.0, // Default height
  this.width = double.infinity, // Default width takes all available space
  this.backgroundColor = AppColors.primaryColor, // Default background color
  required this.text, // Required parameter for text
  this.textStyle = const TextStyle(
      fontSize: 16.0,
      fontWeight: FontWeight.bold,
      color: Colors.white), // Default text style
  this.foregroundColor = Colors.white, // Default foreground color
  this.borderRadius = 8.0, // Default border radius
  this.onPressed, // Optional onPressed callback
}) : super(key: key);