Fix some textOnly handling
This commit is contained in:
parent
bb037c8162
commit
a150ef2ecf
2 changed files with 35 additions and 26 deletions
|
|
@ -163,7 +163,7 @@ class EventRenderer extends ConsumerWidget {
|
||||||
if (child != null) ...[
|
if (child != null) ...[
|
||||||
if (textOnly)
|
if (textOnly)
|
||||||
child
|
child
|
||||||
else
|
else ...[
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onSecondaryTapUp: contextMenuCallback,
|
onSecondaryTapUp: contextMenuCallback,
|
||||||
onLongPressStart: contextMenuCallback,
|
onLongPressStart: contextMenuCallback,
|
||||||
|
|
@ -189,6 +189,7 @@ class EventRenderer extends ConsumerWidget {
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
] else if (textOnly)
|
] else if (textOnly)
|
||||||
Text("Unknown event type", style: errorStyle),
|
Text("Unknown event type", style: errorStyle),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,17 @@ class MessageRenderer extends ConsumerWidget {
|
||||||
"Unable to decrypt event",
|
"Unable to decrypt event",
|
||||||
style: errorStyle,
|
style: errorStyle,
|
||||||
),
|
),
|
||||||
StickerContent(:final url, :final info) =>
|
StickerContent(:final body, :final url, :final info) =>
|
||||||
ConstrainedBox(
|
textOnly
|
||||||
constraints: BoxConstraints.loose(Size.square(200)),
|
? Text(
|
||||||
|
body,
|
||||||
|
maxLines: maxLines,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
)
|
||||||
|
: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints.loose(
|
||||||
|
Size.square(200),
|
||||||
|
),
|
||||||
child: MessageImage(
|
child: MessageImage(
|
||||||
url.mxcToHttps(
|
url.mxcToHttps(
|
||||||
ref.watch(
|
ref.watch(
|
||||||
|
|
@ -272,7 +280,7 @@ class MessageRenderer extends ConsumerWidget {
|
||||||
UrlPreview(link.url),
|
UrlPreview(link.url),
|
||||||
|
|
||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
ReactionRow(event),
|
if (!textOnly) ReactionRow(event),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue