Remove flutter chat #26

Manually merged
Henry-Hiles merged 108 commits from remove-flutter-chat into main 2026-05-22 15:26:28 -04:00
3 changed files with 33 additions and 18 deletions
Showing only changes of commit 8aae2c29cb - Show all commits

Working image rendering

Henry Hiles 2026-05-18 14:52:53 -04:00
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -2,7 +2,7 @@ import "package:flutter/material.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:nexus/models/event.dart";
import "package:nexus/models/relation_type.dart";
import "package:nexus/widgets/chat_page/event_text.dart";
import "package:nexus/widgets/chat_page/render_event.dart";
import "package:nexus/widgets/chat_page/lazy_loading/message_avatar.dart";
import "package:nexus/widgets/chat_page/lazy_loading/message_displayname.dart";
@ -55,7 +55,7 @@ class RelationPreview extends ConsumerWidget {
),
Expanded(
child: IgnorePointer(
child: EventText(
child: RenderEvent(
relatedEvent!,
textOnly: true,
maxLines: 1,

View file

@ -22,14 +22,14 @@ import "package:nexus/widgets/loading.dart";
import "package:timeago/timeago.dart";
import "package:flutter_linkify/flutter_linkify.dart";
class EventText extends ConsumerWidget {
class RenderEvent extends ConsumerWidget {
final Event event;
final bool textOnly;
final bool isGrouped;
final int? maxLines;
final VoidCallback? onTapReply;
final IList<PopupMenuEntry> Function(Event event)? getEventOptions;
const EventText(
const RenderEvent(
this.event, {
this.onTapReply,
this.textOnly = false,
@ -64,14 +64,18 @@ class EventText extends ConsumerWidget {
onLongPressStart: contextMenuCallback,
child: switch (event.content) {
MessageContent() => Row(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8,
children: [
isGrouped ? SizedBox(width: 40) : MessageAvatar(event, height: 40),
isGrouped || textOnly
? SizedBox(width: 40)
: MessageAvatar(event, height: 40),
Expanded(
child: Column(
spacing: 4,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (!isGrouped)
if (!isGrouped && !textOnly)
Row(
spacing: 4,
children: [
@ -123,6 +127,7 @@ class EventText extends ConsumerWidget {
:final formattedBody,
:final format,
) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
format == "org.matrix.custom.html" && !textOnly
? Html(
@ -191,16 +196,26 @@ class EventText extends ConsumerWidget {
width: info?.width,
height: info?.height,
loadingBuilder:
(
context,
child,
loadingProgress,
) => switch (info?.blurHash) {
final blurHash? => BlurHash(
hash: blurHash,
),
_ => Loading(),
},
(_, child, loadingProgress) =>
loadingProgress == null
? child
: switch (info?.blurHash) {
final blurHash? =>
SizedBox(
width:
info?.width ??
info?.height ??
200,
height:
info?.height ??
info?.width ??
200,
child: BlurHash(
hash: blurHash,
),
),
_ => Loading(),
},
errorBuilder:
(context, error, stackTrace) =>
Center(

View file

@ -18,7 +18,7 @@ import "package:nexus/models/relation_type.dart";
import "package:nexus/models/requests/report_request.dart";
import "package:nexus/widgets/chat_page/composer/chat_box.dart";
import "package:nexus/widgets/chat_page/emoji_picker_button.dart";
import "package:nexus/widgets/chat_page/event_text.dart";
import "package:nexus/widgets/chat_page/render_event.dart";
import "package:nexus/widgets/chat_page/member_list.dart";
import "package:nexus/widgets/chat_page/room_appbar.dart";
import "package:nexus/widgets/chat_page/wrappers/event_wrapper.dart";
@ -329,7 +329,7 @@ class RoomChat extends HookConsumerWidget {
padding: EdgeInsets.symmetric(vertical: 8),
child: EventWrapper(
value[index],
EventText(
RenderEvent(
value[index],
onTapReply: () =>
listController.value.animateToItem(