feat: chat view with timeline, message bubbles, reply and send

This commit is contained in:
Bernd Steckmeister
2026-04-19 20:09:43 +02:00
parent 5a909f0e0d
commit c108e5b8e2
4 changed files with 520 additions and 3 deletions
+22
View File
@@ -0,0 +1,22 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:matrix/matrix.dart';
import 'package:pyramid/core/matrix_client.dart';
final timelineProvider =
FutureProvider.family<Timeline, String>((ref, roomId) async {
final client = await ref.watch(matrixClientProvider.future);
final room = client.getRoomById(roomId);
if (room == null) throw Exception('Raum nicht gefunden: $roomId');
final timeline = await room.getTimeline(
onUpdate: () => ref.invalidateSelf(),
);
ref.onDispose(timeline.cancelSubscriptions);
return timeline;
});
final roomProvider = Provider.family<Room?, String>((ref, roomId) {
final client = ref.watch(matrixClientProvider).valueOrNull;
return client?.getRoomById(roomId);
});