|
|
|
|
@ -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 {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|