mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-09-18 21:38:48 +00:00
Use DisplayString for messages
This commit is contained in:
@@ -392,7 +392,7 @@ class _ConversationScreenState extends State<ConversationScreen> {
|
||||
context: context,
|
||||
title: tr("Update message"),
|
||||
message: tr("Please enter new message content:"),
|
||||
defaultValue: message.message,
|
||||
defaultValue: message.message.content,
|
||||
hint: tr("New message"));
|
||||
|
||||
if (newContent == null) return;
|
||||
|
@@ -2,7 +2,7 @@ import 'package:comunic/models/conversation_message.dart';
|
||||
import 'package:comunic/models/user.dart';
|
||||
import 'package:comunic/ui/widgets/account_image_widget.dart';
|
||||
import 'package:comunic/ui/widgets/network_image_widget.dart';
|
||||
import 'package:comunic/ui/widgets/text_rich_content_widget.dart';
|
||||
import 'package:comunic/ui/widgets/text_widget.dart';
|
||||
import 'package:comunic/utils/date_utils.dart';
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
import 'package:comunic/utils/ui_utils.dart';
|
||||
@@ -124,8 +124,8 @@ class ConversationMessageTile extends StatelessWidget {
|
||||
width: 200.0,
|
||||
alignment: Alignment.centerRight,
|
||||
child: Container(
|
||||
child: TextRichContentWidget(
|
||||
message.message,
|
||||
child: TextWidget(
|
||||
content: message.message,
|
||||
textAlign: TextAlign.justify,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
@@ -199,8 +199,8 @@ class ConversationMessageTile extends StatelessWidget {
|
||||
width: 200.0,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Container(
|
||||
child: TextRichContentWidget(
|
||||
message.message,
|
||||
child: TextWidget(
|
||||
content: message.message,
|
||||
textAlign: TextAlign.justify,
|
||||
style: TextStyle(
|
||||
color: darkTheme()
|
||||
|
@@ -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