make message flash when tapping reply

This commit is contained in:
Henry Hiles 2026-03-18 21:49:43 -04:00
commit a6aee7565a
No known key found for this signature in database
5 changed files with 127 additions and 102 deletions

View file

@ -66,6 +66,7 @@ class MessageController extends AsyncNotifier<Message?> {
),
).future,
),
"flashing": false,
"timelineId": event.timelineRowId,
"big": event.localContent?.bigEmoji == true,
"eventType": type,

View file

@ -1,3 +1,5 @@
import "dart:async";
import "package:collection/collection.dart";
import "package:fast_immutable_collections/fast_immutable_collections.dart";
import "package:flutter_chat_core/flutter_chat_core.dart";
@ -282,6 +284,16 @@ class RoomChatController extends AsyncNotifier<InMemoryChatController> {
Future<void> scrollToMessage(Message message) async {
final controller = await future;
Future<void> setFlashing(bool flashing) => controller.updateMessage(
message,
message.copyWith(
metadata: {...(message.metadata ?? {}), "flashing": flashing},
),
);
await setFlashing(true);
Timer(Duration(seconds: 1), () => setFlashing(false));
return await controller.scrollToMessage(message.id);
}