style: Make invite page more pretty

This commit is contained in:
Krille 2023-02-05 13:08:58 +01:00
parent cef5fbe3c8
commit cf88eb1fd7
2 changed files with 37 additions and 16 deletions

View File

@ -79,7 +79,7 @@ class InvitationSelectionController extends State<InvitationSelection> {
void searchUserWithCoolDown(String text) async {
coolDown?.cancel();
coolDown = Timer(
const Duration(seconds: 1),
const Duration(milliseconds: 500),
() => searchUser(context, text),
);
}

View File

@ -28,21 +28,32 @@ class InvitationSelectionView extends StatelessWidget {
.toSegments(['rooms', controller.roomId!]),
),
titleSpacing: 0,
title: TextField(
autofocus: true,
decoration: InputDecoration(
hintText: L10n.of(context)!.inviteContactToGroup(groupName),
suffixIconConstraints: const BoxConstraints(
maxWidth: 48,
maxHeight: 48,
minWidth: 48,
title: SizedBox(
height: 44,
child: Padding(
padding: const EdgeInsets.only(right: 12.0),
child: TextField(
textInputAction: TextInputAction.search,
decoration: InputDecoration(
hintText: L10n.of(context)!.inviteContactToGroup(groupName),
suffixIcon: controller.loading
? const Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 12,
),
child: SizedBox.square(
dimension: 24,
child: CircularProgressIndicator.adaptive(
strokeWidth: 2,
),
),
)
: const Icon(Icons.search_outlined),
),
onChanged: controller.searchUserWithCoolDown,
),
suffixIcon: controller.loading
? const CircularProgressIndicator.adaptive()
: const Icon(Icons.search_outlined),
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
),
onChanged: controller.searchUserWithCoolDown,
),
),
body: MaxWidthBody(
@ -85,8 +96,18 @@ class InvitationSelectionView extends StatelessWidget {
mxContent: contacts[i].avatarUrl,
name: contacts[i].calcDisplayname(),
),
title: Text(contacts[i].calcDisplayname()),
subtitle: Text(contacts[i].id),
title: Text(
contacts[i].calcDisplayname(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
subtitle: Text(
contacts[i].id,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary),
),
onTap: () =>
controller.inviteAction(context, contacts[i].id),
),