mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Use DisplayString for messages
This commit is contained in:
@ -15,11 +15,13 @@ class TextWidget extends StatelessWidget {
|
||||
final DisplayedString content;
|
||||
final bool parseBBcode;
|
||||
final TextStyle style;
|
||||
final TextAlign textAlign;
|
||||
|
||||
const TextWidget({
|
||||
Key key,
|
||||
@required this.content,
|
||||
this.parseBBcode = false,
|
||||
this.textAlign = TextAlign.start,
|
||||
this.style,
|
||||
}) : assert(content != null),
|
||||
assert(parseBBcode != null),
|
||||
@ -40,6 +42,7 @@ class TextWidget extends StatelessWidget {
|
||||
|
||||
// Just parse link
|
||||
return RichText(
|
||||
textAlign: textAlign,
|
||||
text: TextSpan(children: _parseLinks(context, content, style)),
|
||||
);
|
||||
}
|
||||
@ -74,7 +77,7 @@ class TextWidget extends StatelessWidget {
|
||||
child: InkWell(
|
||||
child: Text(
|
||||
word,
|
||||
style: style.copyWith(color: Colors.blueAccent),
|
||||
style: style.copyWith(color: Colors.indigo),
|
||||
),
|
||||
onTap: () => launch(word),
|
||||
),
|
||||
@ -93,7 +96,7 @@ class TextWidget extends StatelessWidget {
|
||||
child: InkWell(
|
||||
child: Text(
|
||||
word,
|
||||
style: style.copyWith(color: Colors.blueAccent),
|
||||
style: style.copyWith(color: Colors.indigo),
|
||||
),
|
||||
onTap: () => openVirtualDirectory(context, word),
|
||||
),
|
||||
@ -110,7 +113,8 @@ class TextWidget extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
if (buff.isNotEmpty) changeWordType();
|
||||
if (buff.isNotEmpty && (buff.length > 1 || buff.toString() != " "))
|
||||
changeWordType();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
Reference in New Issue
Block a user