mirror of
				https://gitlab.com/famedly/fluffychat.git
				synced 2025-11-04 06:17:26 +01:00 
			
		
		
		
	chore: Enhance invitiation UX
This commit is contained in:
		
							parent
							
								
									d25d8cc1c2
								
							
						
					
					
						commit
						c420343db9
					
				@ -26,7 +26,6 @@ void main() {
 | 
			
		||||
      await tester.pumpAndSettle();
 | 
			
		||||
 | 
			
		||||
      expect(find.text('Connect'), findsOneWidget);
 | 
			
		||||
      expect(find.text('Homeserver'), findsOneWidget);
 | 
			
		||||
 | 
			
		||||
      final input = find.byType(TextField);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -180,11 +180,12 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
 | 
			
		||||
                                .onSecondaryContainer,
 | 
			
		||||
                          ),
 | 
			
		||||
                          title: Text(
 | 
			
		||||
                            Matrix.of(context)
 | 
			
		||||
                                    .client
 | 
			
		||||
                                    .encryption!
 | 
			
		||||
                                    .keyManager
 | 
			
		||||
                                    .enabled
 | 
			
		||||
                            (Matrix.of(context)
 | 
			
		||||
                                        .client
 | 
			
		||||
                                        .encryption
 | 
			
		||||
                                        ?.keyManager
 | 
			
		||||
                                        .enabled ==
 | 
			
		||||
                                    true)
 | 
			
		||||
                                ? L10n.of(context)!.unlockOldMessages
 | 
			
		||||
                                : L10n.of(context)!.enableAutoBackups,
 | 
			
		||||
                            style: TextStyle(
 | 
			
		||||
 | 
			
		||||
@ -2,6 +2,7 @@ import 'dart:async';
 | 
			
		||||
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
import 'package:adaptive_dialog/adaptive_dialog.dart';
 | 
			
		||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
 | 
			
		||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
 | 
			
		||||
import 'package:matrix/matrix.dart';
 | 
			
		||||
@ -50,10 +51,19 @@ class InvitationSelectionController extends State<InvitationSelection> {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void inviteAction(BuildContext context, String id) async {
 | 
			
		||||
    final room = Matrix.of(context).client.getRoomById(roomId!);
 | 
			
		||||
    final room = Matrix.of(context).client.getRoomById(roomId!)!;
 | 
			
		||||
    if (OkCancelResult.ok !=
 | 
			
		||||
        await showOkCancelAlertDialog(
 | 
			
		||||
          context: context,
 | 
			
		||||
          title: L10n.of(context)!.inviteContactToGroup(room.displayname),
 | 
			
		||||
          okLabel: L10n.of(context)!.yes,
 | 
			
		||||
          cancelLabel: L10n.of(context)!.cancel,
 | 
			
		||||
        )) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    final success = await showFutureLoadingDialog(
 | 
			
		||||
      context: context,
 | 
			
		||||
      future: () => room!.invite(id),
 | 
			
		||||
      future: () => room.invite(id),
 | 
			
		||||
    );
 | 
			
		||||
    if (success.error == null) {
 | 
			
		||||
      ScaffoldMessenger.of(context).showSnackBar(SnackBar(
 | 
			
		||||
 | 
			
		||||
@ -32,7 +32,14 @@ class InvitationSelectionView extends StatelessWidget {
 | 
			
		||||
          autofocus: true,
 | 
			
		||||
          decoration: InputDecoration(
 | 
			
		||||
            hintText: L10n.of(context)!.inviteContactToGroup(groupName),
 | 
			
		||||
            suffix: const Icon(Icons.search_outlined),
 | 
			
		||||
            suffixIconConstraints: const BoxConstraints(
 | 
			
		||||
              maxWidth: 48,
 | 
			
		||||
              maxHeight: 48,
 | 
			
		||||
              minWidth: 48,
 | 
			
		||||
            ),
 | 
			
		||||
            suffixIcon: controller.loading
 | 
			
		||||
                ? const CircularProgressIndicator.adaptive()
 | 
			
		||||
                : const Icon(Icons.search_outlined),
 | 
			
		||||
            contentPadding: const EdgeInsets.symmetric(horizontal: 16),
 | 
			
		||||
          ),
 | 
			
		||||
          onChanged: controller.searchUserWithCoolDown,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user