diff --git a/lib/pages/chat_details/chat_details.dart b/lib/pages/chat_details/chat_details.dart index ff118811a..6647e820b 100644 --- a/lib/pages/chat_details/chat_details.dart +++ b/lib/pages/chat_details/chat_details.dart @@ -120,6 +120,18 @@ class ChatDetailsController extends State @override void initState() { super.initState(); + initControllers(); + WidgetsBinding.instance.addPostFrameCallback((_) { + nestedScrollViewState.currentState?.innerController.addListener( + _listenerInnerController, + ); + _refreshDataInTabviewInit(); + }); + initValueNotifiers(); + _listenForRoomMembersChanged(); + } + + void initControllers() { tabController = TabController( length: chatDetailsPageView.length, vsync: this, @@ -139,15 +151,12 @@ class ChatDetailsController extends State searchFunc: (event) => event.isAFile, limit: _filesFetchLimit, ); - WidgetsBinding.instance.addPostFrameCallback((_) { - nestedScrollViewState.currentState?.innerController.addListener( - _listenerInnerController, - ); - _refreshDataInTabviewInit(); - }); + } + + void initValueNotifiers() { room = Matrix.of(context).client.getRoomById(roomId!); muteNotifier.value = room?.pushRuleState ?? PushRuleState.notify; - _listenForRoomMembersChanged(); + membersNotifier.value ??= room?.getParticipants(); } void _listenForRoomMembersChanged() { @@ -163,6 +172,7 @@ class ChatDetailsController extends State void dispose() { tabController?.dispose(); muteNotifier.dispose(); + membersNotifier.dispose(); mediaListController?.dispose(); linksListController?.dispose(); filesListController?.dispose();