You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB
Dart

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<Color>(hexToColor),
backgroundColor: MaterialStateProperty.all<Color>(Colors.white),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
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,
),
);
}
}