import 'package:flutter/material.dart'; class HollowButtonComponent extends StatelessWidget { const HollowButtonComponent({ Key? key, required this.label, required this.onPressed, this.alignmentIcon, this.icon, required this.hexToColor, }) : super(key: key); final String label; final Function() onPressed; final IconData? icon; final AlignmentGeometry? alignmentIcon; final Color hexToColor; @override Widget build(BuildContext context) { return SizedBox( width: MediaQuery.of(context).size.width * 0.9, height: 70, child: ElevatedButton( style: ButtonStyle( foregroundColor: MaterialStateProperty.all(hexToColor), backgroundColor: MaterialStateProperty.all(Colors.white), shape: MaterialStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), side: BorderSide(color: hexToColor), ), ), ), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text(label, textScaleFactor: 1.0, style: const TextStyle(fontSize: 15), textAlign: TextAlign.center), Visibility( visible: icon != null, child: Container( alignment: alignmentIcon, child: Icon(icon), ), ), ], ), onPressed: onPressed, ), ); } }