diff --git a/docs/adr/0009-Instructions-for-naming-twake-events.md b/docs/adr/0009-Instructions-for-naming-twake-events.md new file mode 100644 index 0000000000..8efe8737cf --- /dev/null +++ b/docs/adr/0009-Instructions-for-naming-twake-events.md @@ -0,0 +1,73 @@ +# 7. Instructions for naming twake events + +Date: 2023-10-03 + +## Status + +Accepted + +## Docs + +- [Spec](https://spec.matrix.org/v1.6/#events) + +## Context + +- All data exchanged through Matrix is represented as an “event”. In addition, we have local support events. +- We can use local events to handle logic and behavior by injecting events into a defined stream. + +## Decision + +How to name events +- Below are the naming rules for events. +- App.twake is the name of the application. +- Inapp is event use for local support. +- Profile is the name of the feature. +- Avatar is the name of the event. + ex: 'app.twake.inapp.profile.avatar' + +How to use events. +- Send event + +``` +class TwakeEventDispatcher { + static final TwakeEventDispatcher _twakeEventDispatcher = + TwakeEventDispatcher._instance(); + + factory TwakeEventDispatcher() { + return _twakeEventDispatcher; + } + + TwakeEventDispatcher._instance(); + + void sendAccountDataEvent({ + required Client client, + required BasicEvent basicEvent, + }) { + client.onAccountData.add(basicEvent); + } +} + +twakeEventDispatcher.sendAccountDataEvent( + client: client, + basicEvent: BasicEvent( + type: TwakeInappEventTypes.uploadAvatarEvent, + content: profile.toJson(), + ), + ); +``` +- Listen event and handle it + +``` +client.onAccountData.stream.listen((event) { + Logs().d( + 'FetchProfileMixin::onAccountData() - EventType: ${event.type} - EventContent: ${event.content}', + ); + if (event.type == TwakeInappEventTypes.uploadAvatarEvent) { + profileNotifier.value = Profile.fromJson(event.content); + } + }); +``` + +## Consequences + +- If we do not specifically define the event, it will be duplicated with the homeserver event \ No newline at end of file diff --git a/lib/pages/settings_dashboard/settings/settings.dart b/lib/pages/settings_dashboard/settings/settings.dart index 050e2c1438..720b0c28c3 100644 --- a/lib/pages/settings_dashboard/settings/settings.dart +++ b/lib/pages/settings_dashboard/settings/settings.dart @@ -1,11 +1,13 @@ +import 'dart:async'; + import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/data/hive/hive_collection_tom_database.dart'; import 'package:fluffychat/di/global/get_it_initializer.dart'; +import 'package:fluffychat/event/twake_inapp_event_types.dart'; import 'package:fluffychat/pages/bootstrap/bootstrap_dialog.dart'; import 'package:fluffychat/pages/connect/connect_page_mixin.dart'; import 'package:fluffychat/presentation/enum/settings/settings_enum.dart'; import 'package:fluffychat/presentation/extensions/client_extension.dart'; -import 'package:fluffychat/presentation/mixins/fetch_profile_mixin.dart'; import 'package:fluffychat/utils/url_launcher.dart'; import 'package:fluffychat/widgets/matrix.dart'; import 'package:flutter/material.dart'; @@ -30,8 +32,13 @@ class Settings extends StatefulWidget { SettingsController createState() => SettingsController(); } -class SettingsController extends State - with ConnectPageMixin, FetchProfileMixin { +class SettingsController extends State with ConnectPageMixin { + final ValueNotifier profileNotifier = ValueNotifier( + Profile(userId: ''), + ); + + StreamSubscription? onAccountDataSubscription; + final List getListSettingItem = [ SettingEnum.chatSettings, SettingEnum.privacyAndSecurity, @@ -79,14 +86,15 @@ class SettingsController extends State Client get client => Matrix.of(context).client; - @override - void initState() { - getCurrentProfile(client); - handleOnAccountData(client); - WidgetsBinding.instance.addPostFrameCallback((_) { - checkBootstrap(); - }); - super.initState(); + void _getCurrentProfile(Client client) async { + final profile = await client.getProfileFromUserId( + client.userID!, + getFromRooms: false, + ); + Logs().d( + 'Settings::_getCurrentProfile() - currentProfile: $profile', + ); + profileNotifier.value = profile; } void checkBootstrap() async { @@ -168,6 +176,30 @@ class SettingsController extends State } } + void _handleOnAccountDataSubscription() { + onAccountDataSubscription = client.onAccountData.stream.listen((event) { + if (event.type == TwakeInappEventTypes.uploadAvatarEvent) { + profileNotifier.value = Profile.fromJson(event.content); + } + }); + } + + @override + void initState() { + _getCurrentProfile(client); + _handleOnAccountDataSubscription(); + WidgetsBinding.instance.addPostFrameCallback((_) { + checkBootstrap(); + }); + super.initState(); + } + + @override + void dispose() { + onAccountDataSubscription?.cancel(); + super.dispose(); + } + @override Widget build(BuildContext context) { return SettingsView( diff --git a/lib/pages/settings_dashboard/settings_profile/settings_profile.dart b/lib/pages/settings_dashboard/settings_profile/settings_profile.dart index 7dbbb2f66e..dc0fa09e40 100644 --- a/lib/pages/settings_dashboard/settings_profile/settings_profile.dart +++ b/lib/pages/settings_dashboard/settings_profile/settings_profile.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:adaptive_dialog/adaptive_dialog.dart'; import 'package:file_picker/file_picker.dart'; import 'package:fluffychat/config/app_config.dart'; @@ -8,7 +10,6 @@ import 'package:fluffychat/pages/settings_dashboard/settings_profile/settings_pr import 'package:fluffychat/pages/settings_dashboard/settings_profile/settings_profile_view.dart'; import 'package:fluffychat/presentation/enum/settings/settings_profile_enum.dart'; import 'package:fluffychat/presentation/extensions/client_extension.dart'; -import 'package:fluffychat/presentation/mixins/fetch_profile_mixin.dart'; import 'package:fluffychat/utils/extension/value_notifier_extension.dart'; import 'package:fluffychat/utils/platform_infos.dart'; import 'package:fluffychat/widgets/matrix.dart'; @@ -31,8 +32,11 @@ class SettingsProfile extends StatefulWidget { State createState() => SettingsProfileController(); } -class SettingsProfileController extends State - with FetchProfileMixin { +class SettingsProfileController extends State { + final ValueNotifier profileNotifier = ValueNotifier( + Profile(userId: ''), + ); + final TwakeEventDispatcher twakeEventDispatcher = getIt.get(); @@ -117,7 +121,7 @@ class SettingsProfileController extends State future: () => matrix.client.setAvatar(null), ); if (success.error == null) { - getCurrentProfile(client, isUpdated: true); + _getCurrentProfile(client, isUpdated: true); } return; } @@ -165,7 +169,7 @@ class SettingsProfileController extends State future: () => matrix.client.setAvatar(file), ); if (success.error == null) { - getCurrentProfile(client, isUpdated: true); + _getCurrentProfile(client, isUpdated: true); } } @@ -184,6 +188,22 @@ class SettingsProfileController extends State _handleGetAvatarAction(action); } + void _handleSyncProfile() async { + Logs().d( + 'SettingsProfileController::_handleSyncProfile() - Syncing profile', + ); + twakeEventDispatcher.sendAccountDataEvent( + client: client, + basicEvent: BasicEvent( + type: TwakeInappEventTypes.uploadAvatarEvent, + content: profileNotifier.value.toJson(), + ), + ); + Logs().d( + 'SettingsProfileController::_handleSyncProfile() - Syncing success', + ); + } + void setDisplayNameAction() async { if (displayNameFocusNode.hasFocus) { displayNameFocusNode.unfocus(); @@ -198,12 +218,11 @@ class SettingsProfileController extends State ); if (success.error == null) { isEditedProfileNotifier.toggle(); - getCurrentProfile(client, isUpdated: true); + _getCurrentProfile(client, isUpdated: true); } } - @override - void getCurrentProfile( + void _getCurrentProfile( Client client, { isUpdated = false, }) async { @@ -216,15 +235,9 @@ class SettingsProfileController extends State 'SettingsProfileController::_getCurrentProfile() - currentProfile: $profile', ); profileNotifier.value = profile; - twakeEventDispatcher.sendAccountDataEvent( - client: client, - basicEvent: BasicEvent( - type: TwakeInappEventTypes.uploadAvatarEvent, - content: profile.toJson(), - ), - ); displayNameEditingController.text = displayName; matrixIdEditingController.text = client.mxid(context); + _handleSyncProfile(); } void handleTextEditOnChange(SettingsProfileEnum settingsProfileEnum) { @@ -247,7 +260,7 @@ class SettingsProfileController extends State void _initProfile() { if (widget.profile == null) { - getCurrentProfile(client); + _getCurrentProfile(client); return; } profileNotifier.value = widget.profile!; diff --git a/lib/pages/settings_dashboard/settings_profile/settings_profile_view.dart b/lib/pages/settings_dashboard/settings_profile/settings_profile_view.dart index 82134260f2..eda5b7388a 100644 --- a/lib/pages/settings_dashboard/settings_profile/settings_profile_view.dart +++ b/lib/pages/settings_dashboard/settings_profile/settings_profile_view.dart @@ -84,6 +84,7 @@ class SettingsProfileView extends StatelessWidget { builder: (_) { return SettingsProfileViewMobile( profileNotifier: controller.profileNotifier, + displayName: controller.displayName, onAvatarTap: () => controller.setAvatarAction(), settingsProfileOptions: ListView.separated( shrinkWrap: true, @@ -134,6 +135,7 @@ class SettingsProfileView extends StatelessWidget { builder: (_) { return SettingsProfileViewWeb( profileNotifier: controller.profileNotifier, + displayName: controller.displayName, basicInfoWidget: ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), diff --git a/lib/pages/settings_dashboard/settings_profile/settings_profile_view_mobile.dart b/lib/pages/settings_dashboard/settings_profile/settings_profile_view_mobile.dart index e064d04dc7..44ae1e804f 100644 --- a/lib/pages/settings_dashboard/settings_profile/settings_profile_view_mobile.dart +++ b/lib/pages/settings_dashboard/settings_profile/settings_profile_view_mobile.dart @@ -9,12 +9,14 @@ class SettingsProfileViewMobile extends StatelessWidget { final ValueNotifier profileNotifier; final Widget settingsProfileOptions; final VoidCallback onAvatarTap; + final String displayName; const SettingsProfileViewMobile({ super.key, required this.profileNotifier, required this.settingsProfileOptions, required this.onAvatarTap, + required this.displayName, }); @override @@ -22,7 +24,6 @@ class SettingsProfileViewMobile extends StatelessWidget { return ValueListenableBuilder( valueListenable: profileNotifier, builder: (context, profile, __) { - final displayName = profile.displayName ?? profile.userId; return Column( children: [ Divider( diff --git a/lib/pages/settings_dashboard/settings_profile/settings_profile_view_web.dart b/lib/pages/settings_dashboard/settings_profile/settings_profile_view_web.dart index 7551dce5e4..8af3562d0c 100644 --- a/lib/pages/settings_dashboard/settings_profile/settings_profile_view_web.dart +++ b/lib/pages/settings_dashboard/settings_profile/settings_profile_view_web.dart @@ -11,6 +11,7 @@ class SettingsProfileViewWeb extends StatelessWidget { final Widget basicInfoWidget; final Widget workIdentitiesInfoWidget; final VoidCallback onAvatarTap; + final String displayName; const SettingsProfileViewWeb({ super.key, @@ -18,6 +19,7 @@ class SettingsProfileViewWeb extends StatelessWidget { required this.basicInfoWidget, required this.onAvatarTap, required this.workIdentitiesInfoWidget, + required this.displayName, }); @override @@ -25,7 +27,6 @@ class SettingsProfileViewWeb extends StatelessWidget { return ValueListenableBuilder( valueListenable: profileNotifier, builder: (context, profile, __) { - final displayName = profile.displayName ?? profile.userId; return Padding( padding: SettingsProfileViewWebStyle.paddingBody, child: Center( diff --git a/lib/presentation/mixins/fetch_profile_mixin.dart b/lib/presentation/mixins/fetch_profile_mixin.dart deleted file mode 100644 index dfecb56ca6..0000000000 --- a/lib/presentation/mixins/fetch_profile_mixin.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:fluffychat/event/twake_inapp_event_types.dart'; -import 'package:flutter/material.dart'; -import 'package:matrix/matrix.dart'; - -mixin FetchProfileMixin { - final ValueNotifier profileNotifier = ValueNotifier( - Profile(userId: ''), - ); - - void getCurrentProfile( - Client client, { - isUpdated = false, - }) async { - final profile = await client.getProfileFromUserId( - client.userID!, - cache: !isUpdated, - getFromRooms: false, - ); - Logs().d( - 'FetchProfileMixin::_getCurrentProfile() - currentProfile: $profile', - ); - profileNotifier.value = profile; - } - - void handleOnAccountData(Client client) { - client.onAccountData.stream.listen((event) { - Logs().d( - 'FetchProfileMixin::onAccountData() - EventType: ${event.type} - EventContent: ${event.content}', - ); - if (event.type == TwakeInappEventTypes.uploadAvatarEvent) { - profileNotifier.value = Profile.fromJson(event.content); - } - }); - } -} diff --git a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold.dart b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold.dart index 10bc17cf6c..488ae01802 100644 --- a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold.dart +++ b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold.dart @@ -1,5 +1,4 @@ import 'package:fluffychat/pages/chat_list/client_chooser_button.dart'; -import 'package:fluffychat/presentation/mixins/fetch_profile_mixin.dart'; import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_view.dart'; import 'package:fluffychat/widgets/layouts/enum/adaptive_destinations_enum.dart'; import 'package:fluffychat/widgets/matrix.dart'; @@ -23,8 +22,7 @@ class AdaptiveScaffoldApp extends StatefulWidget { State createState() => AdaptiveScaffoldAppController(); } -class AdaptiveScaffoldAppController extends State - with FetchProfileMixin { +class AdaptiveScaffoldAppController extends State { final ValueNotifier activeNavigationBar = ValueNotifier(AdaptiveDestinationEnum.rooms); @@ -93,20 +91,12 @@ class AdaptiveScaffoldAppController extends State MatrixState get matrix => Matrix.of(context); - @override - void initState() { - getCurrentProfile(matrix.client); - handleOnAccountData(matrix.client); - super.initState(); - } - @override Widget build(BuildContext context) => AppScaffoldView( destinations: destinations, activeRoomId: widget.activeRoomId, activeNavigationBar: activeNavigationBar, pageController: pageController, - profileNotifier: profileNotifier, onOpenSearchPage: _onOpenSearchPage, onCloseSearchPage: _onCloseSearchPage, onDestinationSelected: onDestinationSelected, diff --git a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart index 673fad4e91..3739c32ec4 100644 --- a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart +++ b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart @@ -1,14 +1,14 @@ +import 'dart:async'; + +import 'package:fluffychat/event/twake_inapp_event_types.dart'; import 'package:fluffychat/pages/chat_list/client_chooser_button.dart'; -import 'package:fluffychat/pages/chat_list/client_chooser_button_style.dart'; -import 'package:fluffychat/widgets/avatar/avatar.dart'; -import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_style.dart'; +import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_view.dart'; import 'package:fluffychat/widgets/matrix.dart'; import 'package:flutter/material.dart'; import 'package:matrix/matrix.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; -class AdaptiveScaffoldPrimaryNavigation extends StatelessWidget { - final ValueNotifier profileNotifier; +class AdaptiveScaffoldPrimaryNavigation extends StatefulWidget { final List getNavigationRailDestinations; final int? selectedIndex; final Function(int)? onDestinationSelected; @@ -16,13 +16,27 @@ class AdaptiveScaffoldPrimaryNavigation extends StatelessWidget { const AdaptiveScaffoldPrimaryNavigation({ super.key, - required this.profileNotifier, required this.getNavigationRailDestinations, this.selectedIndex, this.onDestinationSelected, this.onSelected, }); + @override + State createState() => + _AdaptiveScaffoldPrimaryNavigationState(); +} + +class _AdaptiveScaffoldPrimaryNavigationState + extends State { + final ValueNotifier profileNotifier = ValueNotifier( + Profile(userId: ''), + ); + + StreamSubscription? onAccountDataSubscription; + + Client get client => Matrix.of(context).client; + List> _bundleMenuItems(BuildContext context) { return >[ PopupMenuItem( @@ -48,62 +62,47 @@ class AdaptiveScaffoldPrimaryNavigation extends StatelessWidget { ]; } + void _getCurrentProfile(Client client) async { + final profile = await client.getProfileFromUserId( + client.userID!, + getFromRooms: false, + ); + Logs().d( + 'AdaptiveScaffoldPrimaryNavigation::_getCurrentProfile() - currentProfile: $profile', + ); + profileNotifier.value = profile; + } + + void _handleOnAccountDataSubscription() { + onAccountDataSubscription = client.onAccountData.stream.listen((event) { + if (event.type == TwakeInappEventTypes.uploadAvatarEvent) { + profileNotifier.value = Profile.fromJson(event.content); + } + }); + } + + @override + void initState() { + _getCurrentProfile(client); + _handleOnAccountDataSubscription(); + super.initState(); + } + + @override + void dispose() { + onAccountDataSubscription?.cancel(); + super.dispose(); + } + @override Widget build(BuildContext context) { - return Material( - color: Theme.of(context).colorScheme.surface, - child: Container( - margin: AdaptiveScaffoldPrimaryNavigationStyle.primaryNavigationMargin, - width: AdaptiveScaffoldPrimaryNavigationStyle.primaryNavigationWidth, - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: NavigationRail( - selectedIndex: selectedIndex, - destinations: getNavigationRailDestinations, - onDestinationSelected: onDestinationSelected, - labelType: NavigationRailLabelType.all, - backgroundColor: Theme.of(context).colorScheme.surface, - ), - ), - Column( - children: [ - const Padding( - padding: - AdaptiveScaffoldPrimaryNavigationStyle.dividerPadding, - child: Divider( - height: AdaptiveScaffoldPrimaryNavigationStyle.dividerSize, - color: AdaptiveScaffoldPrimaryNavigationStyle - .separatorLightColor, - ), - ), - ValueListenableBuilder( - valueListenable: profileNotifier, - builder: (context, profile, _) { - return PopupMenuButton( - padding: EdgeInsets.zero, - onSelected: onSelected, - itemBuilder: _bundleMenuItems, - child: Avatar( - mxContent: profile.avatarUrl, - name: profile.displayName ?? - Matrix.of(context).client.userID!.localpart, - size: AdaptiveScaffoldPrimaryNavigationStyle.avatarSize, - fontSize: - ClientChooserButtonStyle.avatarFontSizeInAppBar, - ), - ); - }, - ), - ], - ) - ], - ), - ), + return AdaptiveScaffoldPrimaryNavigationView( + getNavigationRailDestinations: widget.getNavigationRailDestinations, + selectedIndex: widget.selectedIndex, + onDestinationSelected: widget.onDestinationSelected, + onSelected: widget.onSelected, + profileNotifier: profileNotifier, + itemBuilder: _bundleMenuItems, ); } } diff --git a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_view.dart b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_view.dart new file mode 100644 index 0000000000..fe8d06a9b7 --- /dev/null +++ b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_view.dart @@ -0,0 +1,84 @@ +import 'package:fluffychat/pages/chat_list/client_chooser_button_style.dart'; +import 'package:fluffychat/widgets/avatar/avatar.dart'; +import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_style.dart'; +import 'package:fluffychat/widgets/matrix.dart'; +import 'package:flutter/material.dart'; +import 'package:matrix/matrix.dart'; + +class AdaptiveScaffoldPrimaryNavigationView extends StatelessWidget { + final List getNavigationRailDestinations; + final int? selectedIndex; + final Function(int)? onDestinationSelected; + final Function(Object)? onSelected; + final ValueNotifier profileNotifier; + final List> Function(BuildContext) itemBuilder; + + const AdaptiveScaffoldPrimaryNavigationView({ + super.key, + required this.getNavigationRailDestinations, + this.selectedIndex, + this.onDestinationSelected, + this.onSelected, + required this.profileNotifier, + required this.itemBuilder, + }); + + @override + Widget build(BuildContext context) { + return Material( + color: Theme.of(context).colorScheme.surface, + child: Container( + margin: AdaptiveScaffoldPrimaryNavigationStyle.primaryNavigationMargin, + width: AdaptiveScaffoldPrimaryNavigationStyle.primaryNavigationWidth, + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surface, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: NavigationRail( + selectedIndex: selectedIndex, + destinations: getNavigationRailDestinations, + onDestinationSelected: onDestinationSelected, + labelType: NavigationRailLabelType.all, + backgroundColor: Theme.of(context).colorScheme.surface, + ), + ), + Column( + children: [ + const Padding( + padding: + AdaptiveScaffoldPrimaryNavigationStyle.dividerPadding, + child: Divider( + height: AdaptiveScaffoldPrimaryNavigationStyle.dividerSize, + color: AdaptiveScaffoldPrimaryNavigationStyle + .separatorLightColor, + ), + ), + ValueListenableBuilder( + valueListenable: profileNotifier, + builder: (context, profile, _) { + return PopupMenuButton( + padding: EdgeInsets.zero, + onSelected: onSelected, + itemBuilder: itemBuilder, + child: Avatar( + mxContent: profile.avatarUrl, + name: profile.displayName ?? + Matrix.of(context).client.userID!.localpart, + size: AdaptiveScaffoldPrimaryNavigationStyle.avatarSize, + fontSize: + ClientChooserButtonStyle.avatarFontSizeInAppBar, + ), + ); + }, + ), + ], + ) + ], + ), + ), + ); + } +} diff --git a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_view.dart b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_view.dart index 5c60db5a1e..5fc9ccf556 100644 --- a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_view.dart +++ b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_view.dart @@ -10,13 +10,11 @@ import 'package:fluffychat/widgets/layouts/enum/adaptive_destinations_enum.dart' import 'package:flutter/material.dart'; import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart'; import 'package:linagora_design_flutter/linagora_design_flutter.dart'; -import 'package:matrix/matrix.dart'; class AppScaffoldView extends StatelessWidget { final List destinations; final ValueNotifier activeNavigationBar; final PageController pageController; - final ValueNotifier profileNotifier; final OnOpenSearchPage onOpenSearchPage; final OnCloseSearchPage onCloseSearchPage; final OnDestinationSelected onDestinationSelected; @@ -39,7 +37,6 @@ class AppScaffoldView extends StatelessWidget { this.activeRoomId, required this.activeNavigationBar, required this.pageController, - required this.profileNotifier, required this.onOpenSearchPage, required this.onCloseSearchPage, required this.onDestinationSelected, @@ -178,7 +175,6 @@ class AppScaffoldView extends StatelessWidget { final destinations = getNavigationDestinations(context); return AdaptiveScaffoldPrimaryNavigation( - profileNotifier: profileNotifier, selectedIndex: activeNavigationBar.value.index, getNavigationRailDestinations: destinations .map((_) => AdaptiveScaffold.toRailDestination(_))