Updated widget
This commit is contained in:
parent
f4ab256fa0
commit
908308b62e
1 changed files with 17 additions and 8 deletions
|
|
@ -10,18 +10,27 @@ class TextWidget extends StatelessWidget {
|
||||||
final bool? underlined;
|
final bool? underlined;
|
||||||
final Color? color;
|
final Color? color;
|
||||||
|
|
||||||
const TextWidget(
|
const TextWidget({
|
||||||
{super.key, required this.text, this.size, this.opacity, this.bold, this.title, this.underlined, this.color});
|
super.key,
|
||||||
|
required this.text,
|
||||||
|
this.size,
|
||||||
|
this.opacity,
|
||||||
|
this.bold,
|
||||||
|
this.title,
|
||||||
|
this.underlined,
|
||||||
|
this.color,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final textStyle = TextStyle(
|
final textStyle = TextStyle(
|
||||||
color: color ?? Color.fromRGBO(255, 255, 255, opacity ?? 1),
|
color: color ?? Color.fromRGBO(255, 255, 255, opacity ?? 1),
|
||||||
fontSize: size ?? 28,
|
fontSize: size ?? 28,
|
||||||
fontWeight: bold == true ? FontWeight.bold : FontWeight.normal,
|
fontWeight: bold == true ? FontWeight.bold : FontWeight.normal,
|
||||||
decoration: underlined == true ? TextDecoration.underline : TextDecoration.none,
|
decoration: underlined == true ? TextDecoration.underline : TextDecoration.none,
|
||||||
decorationColor: color ?? const Color.fromRGBO(255, 255, 255, 1),
|
decorationColor: color ?? const Color.fromRGBO(255, 255, 255, 1),
|
||||||
decorationThickness: 1);
|
decorationThickness: 1,
|
||||||
|
);
|
||||||
|
|
||||||
return title == true
|
return title == true
|
||||||
? Text(text, style: GoogleFonts.outfit(textStyle: textStyle))
|
? Text(text, style: GoogleFonts.outfit(textStyle: textStyle))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue