AppButton constructor
const
AppButton({
- Key? key,
- double height = 50.0,
- double width = double.infinity,
- Color backgroundColor = AppColors.primaryColor,
- required String text,
- TextStyle textStyle = const TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.white),
- Color foregroundColor = Colors.white,
- double borderRadius = 8.0,
- 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);