fix: Center inputfield

This commit is contained in:
Krille Fear 2021-11-13 19:02:26 +01:00
parent 1fb7e03fc6
commit bc41ff3e36
2 changed files with 39 additions and 34 deletions

View File

@ -376,12 +376,15 @@ class ChatView extends StatelessWidget {
), ),
if (controller.room.canSendDefaultMessages && if (controller.room.canSendDefaultMessages &&
controller.room.membership == Membership.join) controller.room.membership == Membership.join)
Padding( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
bottom: bottomSheetPadding, bottom: bottomSheetPadding,
left: bottomSheetPadding, left: bottomSheetPadding,
right: bottomSheetPadding, right: bottomSheetPadding,
), ),
constraints: const BoxConstraints(
maxWidth: FluffyThemes.columnWidth * 2.5),
alignment: Alignment.center,
child: Material( child: Material(
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(AppConfig.borderRadius), bottomLeft: Radius.circular(AppConfig.borderRadius),

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/chat/chat.dart'; import 'package:fluffychat/pages/chat/chat.dart';
import 'package:fluffychat/utils/room_status_extension.dart'; import 'package:fluffychat/utils/room_status_extension.dart';
import 'package:fluffychat/widgets/avatar.dart'; import 'package:fluffychat/widgets/avatar.dart';
@ -27,42 +28,43 @@ class SeenByRow extends StatelessWidget {
Matrix.of(context).client.userID Matrix.of(context).client.userID
? Alignment.topRight ? Alignment.topRight
: Alignment.topLeft, : Alignment.topLeft,
padding: const EdgeInsets.only( padding: const EdgeInsets.only(bottom: 4),
left: 16, child: Container(
right: 16, constraints:
bottom: 4, const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5),
), alignment: Alignment.center,
child: Wrap( child: Wrap(
spacing: 4, spacing: 4,
children: [ children: [
...(seenByUsers.length > maxAvatars ...(seenByUsers.length > maxAvatars
? seenByUsers.sublist(0, maxAvatars) ? seenByUsers.sublist(0, maxAvatars)
: seenByUsers) : seenByUsers)
.map( .map(
(user) => Avatar( (user) => Avatar(
user.avatarUrl, user.avatarUrl,
user.calcDisplayname(), user.calcDisplayname(),
size: 16, size: 16,
fontSize: 9, fontSize: 9,
), ),
) )
.toList(), .toList(),
if (seenByUsers.length > maxAvatars) if (seenByUsers.length > maxAvatars)
SizedBox( SizedBox(
width: 16, width: 16,
height: 16, height: 16,
child: Material( child: Material(
color: Theme.of(context).backgroundColor, color: Theme.of(context).backgroundColor,
borderRadius: BorderRadius.circular(32), borderRadius: BorderRadius.circular(32),
child: Center( child: Center(
child: Text( child: Text(
'+${seenByUsers.length - maxAvatars}', '+${seenByUsers.length - maxAvatars}',
style: const TextStyle(fontSize: 9), style: const TextStyle(fontSize: 9),
),
), ),
), ),
), ),
), ],
], ),
), ),
); );
} }