Colored text

This commit is contained in:
ivan2282
2025-11-30 22:48:41 +03:00
parent 42cb4774b5
commit 58e18b06a8

View File

@@ -3752,13 +3752,38 @@ class ChatMessageBubble extends StatelessWidget {
],
if (message.text.isNotEmpty) ...[
if (message.text.contains("welcome.saved.dialog.message"))
Container(
alignment: Alignment.center,
child: Text(
'Привет! Это твои избранные. Все написанное сюда попадёт прямиком к дяде Майору.',
style: TextStyle(color: textColor, fontStyle: FontStyle.italic),
textAlign: TextAlign.center,
),
Linkify(
text:'Привет! Это твои избранные. Все написанное сюда попадёт прямиком к дяде Майору.',
style: TextStyle(color: textColor, fontStyle: FontStyle.italic),
linkStyle: linkStyle,
onOpen: onOpenLink,
options: const LinkifyOptions(humanize: false),
textAlign: TextAlign.left,
)
else if (message.text.contains("komet.custom_text"))
Linkify(
style: message.text.contains("komet.custom_text.red") ?
TextStyle(color: Color.from(alpha: 255, red: 255, green: 0, blue: 0)) :
message.text.contains("komet.custom_text.black") ?
TextStyle(color: Color.from(alpha: 255, red: 0, green: 0, blue: 0)) :
message.text.contains("komet.custom_text.green") ?
TextStyle(color: Color.from(alpha: 255, red: 0, green: 255, blue: 0)) :
message.text.contains("komet.custom_text.white") ?
TextStyle(color: Color.from(alpha: 255, red: 255, green: 255, blue: 255)) : defaultTextStyle,
linkStyle: linkStyle,
onOpen: onOpenLink,
options: const LinkifyOptions(humanize: false),
textAlign: message.text.contains("komet.custom_text.right")
? TextAlign.right
: message.text.contains("komet.custom_text.center") ? TextAlign.center : TextAlign.left,
text: message.text
.replaceAll("komet.custom_text.red", "")
.replaceAll("komet.custom_text.black", "")
.replaceAll("komet.custom_text.green", "")
.replaceAll("komet.custom_text.white", "")
.replaceAll("komet.custom_text.right", "")
.replaceAll("komet.custom_text.center", "")
.replaceAll("komet.custom_text", ""),
)
else
Linkify(