import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:test_sa/views/app_style/colors.dart'; import 'package:test_sa/views/app_style/sizing.dart'; class AIconButton extends StatelessWidget { final IconData iconData; final Color color; final Color backgroundColor; final VoidCallback onPressed; final double iconSize; final double buttonSize; const AIconButton({Key key, this.iconData, this.onPressed, this.color, this.iconSize, this.buttonSize = 54, this.backgroundColor}) : super(key: key); @override Widget build(BuildContext context) { return SizedBox( height: buttonSize * AppStyle.getScaleFactor(context), width: buttonSize * AppStyle.getScaleFactor(context), child: ElevatedButton( style: ElevatedButton.styleFrom( padding: EdgeInsets.zero, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular((AppStyle.borderRadius - 4) * AppStyle.getScaleFactor(context))), backgroundColor: backgroundColor ?? AColors.onPrimaryColor, ), onPressed: onPressed, child: FaIcon( iconData, color: color ?? AColors.primaryColor, size: iconSize ?? 32, ), ), ); } }