Colored text
This commit is contained in:
@@ -3752,13 +3752,38 @@ class ChatMessageBubble extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
if (message.text.isNotEmpty) ...[
|
if (message.text.isNotEmpty) ...[
|
||||||
if (message.text.contains("welcome.saved.dialog.message"))
|
if (message.text.contains("welcome.saved.dialog.message"))
|
||||||
Container(
|
Linkify(
|
||||||
alignment: Alignment.center,
|
text:'Привет! Это твои избранные. Все написанное сюда попадёт прямиком к дяде Майору.',
|
||||||
child: Text(
|
style: TextStyle(color: textColor, fontStyle: FontStyle.italic),
|
||||||
'Привет! Это твои избранные. Все написанное сюда попадёт прямиком к дяде Майору.',
|
linkStyle: linkStyle,
|
||||||
style: TextStyle(color: textColor, fontStyle: FontStyle.italic),
|
onOpen: onOpenLink,
|
||||||
textAlign: TextAlign.center,
|
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
|
else
|
||||||
Linkify(
|
Linkify(
|
||||||
|
|||||||
Reference in New Issue
Block a user