Watch
1
0
Fork
You've already forked nexus
0
forked from Nexus/nexus

add typing indicators

Fixes #92
This commit is contained in:
Henry Hiles 2026-10-21 15:07:02 -04:00
commit 0fcbc275cd
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -13,6 +13,9 @@ class const ChatTimeline({
required final IList<PopupMenuEntry> Function(Event) getEventOptions,
required final int? highlightedEvent,
required final double composerHeight,
/// The typing indicator's height, or zero while it's hidden.
required final double typingIndicatorHeight,
final void Function(int rowId)? onSwipe,
super.key,
}) extends StatelessWidget {
@ -40,7 +43,22 @@ class const ChatTimeline({
keyboardDismissBehavior: .onDrag,
controller: scroll.scrollController,
slivers: [
SliverToBoxAdapter(child: SizedBox(height: composerHeight)),
SliverToBoxAdapter(
child: Column(
children: [
// Makes room for the typing indicator, with a small gap above it,
// so it doesn't cover messages
AnimatedContainer(
duration: Durations.medium2,
curve: Curves.easeInOutCubicEmphasized,
height: typingIndicatorHeight == 0
? 0
: typingIndicatorHeight + 4,
),
SizedBox(height: composerHeight),
],
),
),
SuperSliverList.builder(
itemCount: scroll.liveRows.length,