From 89924242f43d19efc0591446c5f9317b253818cb Mon Sep 17 00:00:00 2001 From: Rafael <1024481@stud.hs-mannheim.de> Date: Thu, 20 Jun 2024 03:44:53 +0200 Subject: [PATCH] Updated TextWithBold to accept font sizes. --- lib/components/text_with_bold.dart | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/components/text_with_bold.dart b/lib/components/text_with_bold.dart index 9bac8a4..4a690a0 100644 --- a/lib/components/text_with_bold.dart +++ b/lib/components/text_with_bold.dart @@ -4,21 +4,37 @@ class TextWithBold extends StatelessWidget { final String? leadingText; final String boldText; final String? trailingText; + final double? leadingSize; + final double? boldSize; + final double? trailingSize; - const TextWithBold( - {super.key, this.leadingText, required this.boldText, this.trailingText}); + const TextWithBold({ + super.key, + this.leadingText, + required this.boldText, + this.trailingText, + this.leadingSize, + this.boldSize, + this.trailingSize, + }); @override Widget build(BuildContext context) { return Text.rich( TextSpan( children: [ - TextSpan(text: leadingText), + TextSpan( + text: leadingText, + style: TextStyle(fontSize: leadingSize), + ), TextSpan( text: boldText, - style: const TextStyle(fontWeight: FontWeight.bold), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: boldSize), + ), + TextSpan( + text: trailingText, + style: TextStyle(fontSize: trailingSize), ), - TextSpan(text: trailingText), ], ), );