feat: Jump to last read event
This commit is contained in:
parent
c00a6e3d00
commit
5c70dd39bc
3 changed files with 62 additions and 16 deletions
|
|
@ -174,7 +174,7 @@ class ChatView extends StatelessWidget {
|
|||
}
|
||||
},
|
||||
child: GestureDetector(
|
||||
onTapDown: controller.setReadMarker,
|
||||
onTapDown: (_) => controller.setReadMarker(),
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: StreamBuilder(
|
||||
stream: controller.room!.onUpdate.stream
|
||||
|
|
@ -351,6 +351,31 @@ class ChatView extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
if (!controller.lastReadEventVisible)
|
||||
Positioned(
|
||||
top: 16,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(
|
||||
child: FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.arrow_upward_outlined),
|
||||
onPressed: () => controller
|
||||
.scrollToEventId(controller.room!.fullyRead),
|
||||
label: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(L10n.of(context)!.jumpToLastReadMessage),
|
||||
IconButton(
|
||||
onPressed: () => controller.setReadMarker(
|
||||
eventId: controller.room!.fullyRead,
|
||||
),
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (controller.dragging)
|
||||
Container(
|
||||
color: Theme.of(context)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue