style: Make invite page more pretty

This commit is contained in:
Krille 2023-02-05 13:08:58 +01:00
parent 5bd0689172
commit f0e765c3ce
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 { void searchUserWithCoolDown(String text) async {
coolDown?.cancel(); coolDown?.cancel();
coolDown = Timer( coolDown = Timer(
const Duration(seconds: 1), const Duration(milliseconds: 500),
() => searchUser(context, text), () => searchUser(context, text),
); );
} }

View file

@ -28,23 +28,34 @@ class InvitationSelectionView extends StatelessWidget {
.toSegments(['rooms', controller.roomId!]), .toSegments(['rooms', controller.roomId!]),
), ),
titleSpacing: 0, titleSpacing: 0,
title: TextField( title: SizedBox(
autofocus: true, height: 44,
child: Padding(
padding: const EdgeInsets.only(right: 12.0),
child: TextField(
textInputAction: TextInputAction.search,
decoration: InputDecoration( decoration: InputDecoration(
hintText: L10n.of(context)!.inviteContactToGroup(groupName), hintText: L10n.of(context)!.inviteContactToGroup(groupName),
suffixIconConstraints: const BoxConstraints(
maxWidth: 48,
maxHeight: 48,
minWidth: 48,
),
suffixIcon: controller.loading suffixIcon: controller.loading
? const CircularProgressIndicator.adaptive() ? 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), : const Icon(Icons.search_outlined),
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
), ),
onChanged: controller.searchUserWithCoolDown, onChanged: controller.searchUserWithCoolDown,
), ),
), ),
),
),
body: MaxWidthBody( body: MaxWidthBody(
withScrolling: true, withScrolling: true,
child: controller.foundProfiles.isNotEmpty child: controller.foundProfiles.isNotEmpty
@ -85,8 +96,18 @@ class InvitationSelectionView extends StatelessWidget {
mxContent: contacts[i].avatarUrl, mxContent: contacts[i].avatarUrl,
name: contacts[i].calcDisplayname(), name: contacts[i].calcDisplayname(),
), ),
title: Text(contacts[i].calcDisplayname()), title: Text(
subtitle: Text(contacts[i].id), 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: () => onTap: () =>
controller.inviteAction(context, contacts[i].id), controller.inviteAction(context, contacts[i].id),
), ),