chore: Follow up listen on streams

pull/1113/head^2
krille-chan 1 year ago
parent 8da714b0d2
commit 3b76219f68
No known key found for this signature in database

@ -14,18 +14,26 @@ class TypingIndicators extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<Object>(
stream: controller.room.client.onSync.stream.where(
(syncUpdate) =>
syncUpdate.rooms?.join?[controller.room.id]?.ephemeral
?.any((ephemeral) => ephemeral.type == 'm.typing') ??
false,
),
builder: (context, _) {
final typingUsers = controller.room.typingUsers
..removeWhere((u) => u.stateKey == Matrix.of(context).client.userID);
const topPadding = 20.0;
const bottomPadding = 4.0;
return Container(
width: double.infinity,
alignment: Alignment.center,
child: AnimatedContainer(
constraints:
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5),
height: typingUsers.isEmpty ? 0 : Avatar.defaultSize + bottomPadding,
height:
typingUsers.isEmpty ? 0 : Avatar.defaultSize + bottomPadding,
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
alignment: controller.timeline!.events.isNotEmpty &&
@ -89,6 +97,8 @@ class TypingIndicators extends StatelessWidget {
),
),
);
},
);
}
}

Loading…
Cancel
Save