Updated widget

This commit is contained in:
Patrick Alvin Alcala 2026-02-04 18:28:50 +08:00
parent f4ab256fa0
commit 908308b62e

View file

@ -10,18 +10,27 @@ class TextWidget extends StatelessWidget {
final bool? underlined;
final Color? color;
const TextWidget(
{super.key, required this.text, this.size, this.opacity, this.bold, this.title, this.underlined, this.color});
const TextWidget({
super.key,
required this.text,
this.size,
this.opacity,
this.bold,
this.title,
this.underlined,
this.color,
});
@override
Widget build(BuildContext context) {
final textStyle = TextStyle(
color: color ?? Color.fromRGBO(255, 255, 255, opacity ?? 1),
fontSize: size ?? 28,
fontWeight: bold == true ? FontWeight.bold : FontWeight.normal,
decoration: underlined == true ? TextDecoration.underline : TextDecoration.none,
decorationColor: color ?? const Color.fromRGBO(255, 255, 255, 1),
decorationThickness: 1);
color: color ?? Color.fromRGBO(255, 255, 255, opacity ?? 1),
fontSize: size ?? 28,
fontWeight: bold == true ? FontWeight.bold : FontWeight.normal,
decoration: underlined == true ? TextDecoration.underline : TextDecoration.none,
decorationColor: color ?? const Color.fromRGBO(255, 255, 255, 1),
decorationThickness: 1,
);
return title == true
? Text(text, style: GoogleFonts.outfit(textStyle: textStyle))