fix: Typing indicator too large

This commit is contained in:
Krille Fear 2021-11-14 11:18:33 +01:00
parent db742fad6c
commit c64c988910

View File

@ -14,7 +14,7 @@ class TypingIndicators extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final typingUsers = controller.room.typingUsers final typingUsers = controller.room.typingUsers
..removeWhere((u) => u.stateKey == Matrix.of(context).client.userID); ..removeWhere((u) => u.stateKey == Matrix.of(context).client.userID);
const topPadding = 24.0; const topPadding = 20.0;
const bottomPadding = 4.0; const bottomPadding = 4.0;
return Container( return Container(
@ -23,9 +23,7 @@ class TypingIndicators extends StatelessWidget {
child: AnimatedContainer( child: AnimatedContainer(
constraints: constraints:
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5), const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5),
height: typingUsers.isEmpty height: typingUsers.isEmpty ? 0 : Avatar.defaultSize + bottomPadding,
? 0
: Avatar.defaultSize + bottomPadding + topPadding,
duration: const Duration(milliseconds: 300), duration: const Duration(milliseconds: 300),
curve: Curves.bounceInOut, curve: Curves.bounceInOut,
alignment: controller.filteredEvents.isNotEmpty && alignment: controller.filteredEvents.isNotEmpty &&
@ -83,7 +81,7 @@ class TypingIndicators extends StatelessWidget {
bottomRight: Radius.circular(AppConfig.borderRadius), bottomRight: Radius.circular(AppConfig.borderRadius),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(8),
child: typingUsers.isEmpty child: typingUsers.isEmpty
? null ? null
: Image.asset('assets/typing.gif', height: 12), : Image.asset('assets/typing.gif', height: 12),