pumaButton function
Widget
pumaButton(
{ - String text = "",
- String? subtitle,
- Color color = Colors.white,
- Color textcolor = Colors.black,
- bool disabled = false,
- Icon? icon,
- required void onPressed(),
})
Implementation
Widget pumaButton({
String text = "",
String? subtitle,
Color color = Colors.white,
Color textcolor = Colors.black,
bool disabled = false,
Icon? icon,
required void Function() onPressed,
}) {
return Opacity(
opacity: disabled ? 0.5 : 1,
child: ElevatedButton(
child: Container(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.topCenter,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (icon != null) icon,
Text(
text,
style: TextStyle(
fontFamily: "Futura-Bold", fontSize: 18, color: textcolor),
),
if (subtitle != null)
Opacity(
opacity: 0.58,
child: Text(
text,
style: TextStyle(
fontFamily: "Futura-Bold",
fontSize: 12,
color: textcolor),
),
),
],
),
),
),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(color),
),
onPressed: disabled ? null : onPressed,
),
);
}