diff --git a/lib/pages/chat/direct_chat_empty_view.dart b/lib/pages/chat/direct_chat_empty_view.dart index 6a6b1636d4..3e6bd6e63d 100644 --- a/lib/pages/chat/direct_chat_empty_view.dart +++ b/lib/pages/chat/direct_chat_empty_view.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; class DirectChatEmptyView extends StatelessWidget { - + const DirectChatEmptyView({ Key? key, }) : super(key: key); diff --git a/lib/pages/new_group/new_group.dart b/lib/pages/new_group/new_group.dart index 209d5e44a5..7c1e52d8cf 100644 --- a/lib/pages/new_group/new_group.dart +++ b/lib/pages/new_group/new_group.dart @@ -30,7 +30,6 @@ class NewGroupController extends State final fetchContactsController = FetchContactsController(); final contactStreamController = StreamController>(); final groupNameTextEditingController = TextEditingController(); - final groupchatInfoScrollController = ScrollController(); final selectedContactsMapNotifier = SelectedContactsMapChangeNotifier(); final haveGroupNameNotifier = ValueNotifier(false); @@ -50,7 +49,6 @@ class NewGroupController extends State listenSearchContacts(); listenGroupNameChanged(); fetchContactsController.fetchCurrentTomContacts(); - listenForGroupchatInfoScrollController(); fetchContactsController.listenForScrollChanged(fetchContactsController: fetchContactsController); searchContactsController.onSearchKeywordChanged = (searchKey) { disableLoadMoreInSearch(); @@ -73,16 +71,6 @@ class NewGroupController extends State haveGroupNameNotifier.dispose(); } - void listenForGroupchatInfoScrollController() { - groupchatInfoScrollController.addListener(() { - if (groupchatInfoScrollController.offset > maxScrollOffsetAllowedInPixel) { - groupchatInfoScrollController.jumpTo( - maxScrollOffsetAllowedInPixel, - ); - } - }); - } - void listenContactsStartList() { fetchContactsController.streamController.stream.listen((event) { Logs().d('NewGroupController::fetchContacts() - event: $event'); @@ -143,14 +131,6 @@ class NewGroupController extends State ); } - void autoScrollWhenExpandParticipants() { - groupchatInfoScrollController.animateTo( - MediaQuery.of(context).size.height, - duration: const Duration(milliseconds: 800), - curve: Curves.easeIn, - ); - } - @override Widget build(BuildContext context) => NewGroupView(this); } diff --git a/lib/pages/new_group/new_group_chat_info.dart b/lib/pages/new_group/new_group_chat_info.dart index 6c3a6fe1e8..5221cfb06d 100644 --- a/lib/pages/new_group/new_group_chat_info.dart +++ b/lib/pages/new_group/new_group_chat_info.dart @@ -29,47 +29,43 @@ class NewGroupChatInfo extends StatelessWidget { appBar: _buildAppBar(context), body: Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: SingleChildScrollView( - physics: const ClampingScrollPhysics(), - controller: newGroupController.groupchatInfoScrollController, - child: LayoutBuilder( - builder: (context, constraint) { - return ConstrainedBox( - constraints: BoxConstraints( - maxHeight: MediaQuery.of(context).size.height - MediaQuery.of(context).viewInsets.bottom - ), - child: IntrinsicHeight( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.only(top: 16.0), - child: _buildChangeProfileWidget(context)), - const SizedBox(height: 16.0), - Text(L10n.of(context)!.addAPhoto, - style: Theme.of(context).textTheme.labelLarge?.copyWith( - color: Theme.of(context).colorScheme.onSurface, - ), + child: LayoutBuilder( + builder: (context, constraint) { + return ConstrainedBox( + constraints: BoxConstraints( + maxHeight: MediaQuery.of(context).size.height - MediaQuery.of(context).viewInsets.bottom + ), + child: IntrinsicHeight( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.only(top: 16.0), + child: _buildChangeProfileWidget(context)), + const SizedBox(height: 16.0), + Text(L10n.of(context)!.addAPhoto, + style: Theme.of(context).textTheme.labelLarge?.copyWith( + color: Theme.of(context).colorScheme.onSurface, ), - Text(L10n.of(context)!.maxImageSize(5), - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: LinagoraRefColors.material().neutral[40], - )), - const SizedBox(height: 32), - _buildGroupNameTextFieid(context), - const SizedBox(height: 16), - Expanded( - child: ExpansionParticipantsList( - newGroupController: newGroupController, - contactsList: contactsList, - ), + ), + Text(L10n.of(context)!.maxImageSize(5), + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: LinagoraRefColors.material().neutral[40], + )), + const SizedBox(height: 32), + _buildGroupNameTextFieid(context), + const SizedBox(height: 16), + Expanded( + child: ExpansionParticipantsList( + newGroupController: newGroupController, + contactsList: contactsList, ), - ], - ), + ), + ], ), - ); - } - ), + ), + ); + } ), ), floatingActionButton: ValueListenableBuilder( diff --git a/lib/pages/new_group/widget/expansion_participants_list.dart b/lib/pages/new_group/widget/expansion_participants_list.dart index 6e8a590b1b..0f948e2f5c 100644 --- a/lib/pages/new_group/widget/expansion_participants_list.dart +++ b/lib/pages/new_group/widget/expansion_participants_list.dart @@ -89,9 +89,6 @@ class _ExpansionParticipantsListState extends State { void toggleExpansionList() { setState(() { isExpanded = !isExpanded; - if (isExpanded) { - widget.newGroupController.autoScrollWhenExpandParticipants(); - } }); } } \ No newline at end of file diff --git a/lib/pages/new_private_chat/widget/loading_contact_widget.dart b/lib/pages/new_private_chat/widget/loading_contact_widget.dart index 00f7d9bcde..15d674c542 100644 --- a/lib/pages/new_private_chat/widget/loading_contact_widget.dart +++ b/lib/pages/new_private_chat/widget/loading_contact_widget.dart @@ -12,7 +12,7 @@ class LoadingContactWidget extends StatelessWidget { const SizedBox(height: 16.0,), const CircularProgressIndicator(), const SizedBox(height: 16.0,), - Text(L10n.of(context)!.loadingContacts, + Text(L10n.of(context)!.loadingContacts, style: Theme.of(context).textTheme.bodyMedium?.copyWith( color: Theme.of(context).colorScheme.secondary, ),),