From 1e244ab9be6b2b32d44ac9cd375ef2d77981632f Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Thu, 25 May 2023 14:31:57 +0200 Subject: [PATCH 1/3] neon: make blocs a separate library --- packages/neon/neon/lib/neon.dart | 13 ++--------- .../neon/neon/lib/src/blocs/accounts.dart | 2 +- packages/neon/neon/lib/src/blocs/apps.dart | 2 +- packages/neon/neon/lib/src/blocs/blocs.dart | 23 +++++++++++++++++++ .../neon/neon/lib/src/blocs/capabilities.dart | 2 +- .../neon/neon/lib/src/blocs/first_launch.dart | 2 +- packages/neon/neon/lib/src/blocs/login.dart | 2 +- .../neon/neon/lib/src/blocs/next_push.dart | 2 +- .../lib/src/blocs/push_notifications.dart | 2 +- packages/neon/neon/lib/src/blocs/timer.dart | 2 +- .../neon/neon/lib/src/blocs/user_details.dart | 2 +- .../neon/lib/src/blocs/user_statuses.dart | 2 +- 12 files changed, 35 insertions(+), 21 deletions(-) create mode 100644 packages/neon/neon/lib/src/blocs/blocs.dart diff --git a/packages/neon/neon/lib/neon.dart b/packages/neon/neon/lib/neon.dart index 6992799e..6294ebf9 100644 --- a/packages/neon/neon/lib/neon.dart +++ b/packages/neon/neon/lib/neon.dart @@ -21,6 +21,7 @@ import 'package:http/http.dart'; import 'package:intl/intl_standalone.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:neon/l10n/localizations.dart'; +import 'package:neon/src/blocs/blocs.dart'; import 'package:neon/src/models/account.dart'; import 'package:neon/src/models/push_notification.dart'; import 'package:neon/src/router.dart'; @@ -38,27 +39,17 @@ import 'package:sort_box/sort_box.dart'; import 'package:sqflite/sqflite.dart'; import 'package:sqflite_common_ffi/sqflite_ffi.dart'; import 'package:tray_manager/tray_manager.dart' as tray; -import 'package:unifiedpush/unifiedpush.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'package:window_manager/window_manager.dart'; import 'package:xdg_directories/xdg_directories.dart' as xdg; import 'package:xml/xml.dart' as xml; +export 'src/blocs/blocs.dart'; export 'src/models/account.dart'; export 'src/models/push_notification.dart'; part 'src/app.dart'; -part 'src/blocs/accounts.dart'; -part 'src/blocs/apps.dart'; -part 'src/blocs/capabilities.dart'; -part 'src/blocs/first_launch.dart'; -part 'src/blocs/login.dart'; -part 'src/blocs/next_push.dart'; -part 'src/blocs/push_notifications.dart'; -part 'src/blocs/timer.dart'; -part 'src/blocs/user_details.dart'; -part 'src/blocs/user_statuses.dart'; part 'src/interfaces/notifications.dart'; part 'src/pages/account_settings.dart'; part 'src/pages/home.dart'; diff --git a/packages/neon/neon/lib/src/blocs/accounts.dart b/packages/neon/neon/lib/src/blocs/accounts.dart index 1fda9d6b..1741e52d 100644 --- a/packages/neon/neon/lib/src/blocs/accounts.dart +++ b/packages/neon/neon/lib/src/blocs/accounts.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; const _keyAccounts = 'accounts'; diff --git a/packages/neon/neon/lib/src/blocs/apps.dart b/packages/neon/neon/lib/src/blocs/apps.dart index 3654250f..a2c799cc 100644 --- a/packages/neon/neon/lib/src/blocs/apps.dart +++ b/packages/neon/neon/lib/src/blocs/apps.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; typedef NextcloudApp = NextcloudCoreNavigationApps_Ocs_Data; diff --git a/packages/neon/neon/lib/src/blocs/blocs.dart b/packages/neon/neon/lib/src/blocs/blocs.dart new file mode 100644 index 00000000..e411e525 --- /dev/null +++ b/packages/neon/neon/lib/src/blocs/blocs.dart @@ -0,0 +1,23 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/foundation.dart'; +import 'package:neon/neon.dart'; +import 'package:nextcloud/nextcloud.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:provider/provider.dart'; +import 'package:rxdart/rxdart.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:unifiedpush/unifiedpush.dart'; +import 'package:window_manager/window_manager.dart'; + +part 'accounts.dart'; +part 'apps.dart'; +part 'capabilities.dart'; +part 'first_launch.dart'; +part 'login.dart'; +part 'next_push.dart'; +part 'push_notifications.dart'; +part 'user_details.dart'; +part 'timer.dart'; +part 'user_statuses.dart'; diff --git a/packages/neon/neon/lib/src/blocs/capabilities.dart b/packages/neon/neon/lib/src/blocs/capabilities.dart index 04c7fcd1..bc50560d 100644 --- a/packages/neon/neon/lib/src/blocs/capabilities.dart +++ b/packages/neon/neon/lib/src/blocs/capabilities.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; typedef Capabilities = NextcloudCoreServerCapabilities_Ocs_Data; typedef NextcloudTheme = NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_Theming; diff --git a/packages/neon/neon/lib/src/blocs/first_launch.dart b/packages/neon/neon/lib/src/blocs/first_launch.dart index 92bf2ab4..6716d461 100644 --- a/packages/neon/neon/lib/src/blocs/first_launch.dart +++ b/packages/neon/neon/lib/src/blocs/first_launch.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; abstract class FirstLaunchBlocEvents {} diff --git a/packages/neon/neon/lib/src/blocs/login.dart b/packages/neon/neon/lib/src/blocs/login.dart index 83f3d5f4..cf64e39d 100644 --- a/packages/neon/neon/lib/src/blocs/login.dart +++ b/packages/neon/neon/lib/src/blocs/login.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; abstract class LoginBlocEvents { void setServerURL(final String? url); diff --git a/packages/neon/neon/lib/src/blocs/next_push.dart b/packages/neon/neon/lib/src/blocs/next_push.dart index d13b35a9..59c06137 100644 --- a/packages/neon/neon/lib/src/blocs/next_push.dart +++ b/packages/neon/neon/lib/src/blocs/next_push.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; abstract class NextPushBlocEvents {} diff --git a/packages/neon/neon/lib/src/blocs/push_notifications.dart b/packages/neon/neon/lib/src/blocs/push_notifications.dart index 794218e8..9e37d771 100644 --- a/packages/neon/neon/lib/src/blocs/push_notifications.dart +++ b/packages/neon/neon/lib/src/blocs/push_notifications.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; abstract class PushNotificationsBlocEvents {} diff --git a/packages/neon/neon/lib/src/blocs/timer.dart b/packages/neon/neon/lib/src/blocs/timer.dart index c19f327c..3e0098f8 100644 --- a/packages/neon/neon/lib/src/blocs/timer.dart +++ b/packages/neon/neon/lib/src/blocs/timer.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; abstract class TimerBlocEvents { /// Register a [callback] that will be called periodically. diff --git a/packages/neon/neon/lib/src/blocs/user_details.dart b/packages/neon/neon/lib/src/blocs/user_details.dart index 4227f76a..71e651d7 100644 --- a/packages/neon/neon/lib/src/blocs/user_details.dart +++ b/packages/neon/neon/lib/src/blocs/user_details.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; abstract class UserDetailsBlocEvents {} diff --git a/packages/neon/neon/lib/src/blocs/user_statuses.dart b/packages/neon/neon/lib/src/blocs/user_statuses.dart index 21b8803f..e00a705a 100644 --- a/packages/neon/neon/lib/src/blocs/user_statuses.dart +++ b/packages/neon/neon/lib/src/blocs/user_statuses.dart @@ -1,4 +1,4 @@ -part of '../../neon.dart'; +part of 'blocs.dart'; abstract class UserStatusesBlocEvents { void load(final String username, {final bool force = false}); From 7ccfb72c0bc101b57ac853dc10a19188894e9157 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Thu, 25 May 2023 14:32:00 +0200 Subject: [PATCH 2/3] neon: document AccountsBloc and disable logout with setActiveAccount --- .../neon/neon/lib/src/blocs/accounts.dart | 41 +++++++++++++++---- packages/neon/neon/lib/src/pages/home.dart | 2 +- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/packages/neon/neon/lib/src/blocs/accounts.dart b/packages/neon/neon/lib/src/blocs/accounts.dart index 1741e52d..8951f3f6 100644 --- a/packages/neon/neon/lib/src/blocs/accounts.dart +++ b/packages/neon/neon/lib/src/blocs/accounts.dart @@ -2,15 +2,39 @@ part of 'blocs.dart'; const _keyAccounts = 'accounts'; -abstract class AccountsBlocEvents { +abstract interface class AccountsBlocEvents { + /// Logs in the given [account]. + /// + /// It will also call [setActiveAccount] when no other accounts are registered in [AccountsBlocStates.accounts]. void addAccount(final Account account); + + /// Logs out the given [account]. + /// + /// If [account] is the current [AccountsBlocStates.activeAccount] it will automatically activate the first one in [AccountsBlocStates.accounts]. + /// It is not defined whether listeners of [AccountsBlocStates.accounts] or [AccountsBlocStates.activeAccount] are informed first. void removeAccount(final Account account); + + /// Updates the given [account]. + /// + /// It triggers an event in both [AccountsBlocStates.accounts] and [AccountsBlocStates.activeAccount] to inform all listeners. void updateAccount(final Account account); - void setActiveAccount(final Account? account); + + /// Sets the active [account]. + /// + /// It triggers an event in [AccountsBlocStates.activeAccount] to inform all listeners. + void setActiveAccount(final Account account); } -abstract class AccountsBlocStates { +abstract interface class AccountsBlocStates { + /// All registered accounts. + /// + /// An empty value represents a state where no account is logged in. BehaviorSubject> get accounts; + + /// Currently active account. + /// + /// It should be ensured to only emit an event when it's value changes. + /// A null value represents a state where no user is logged in. BehaviorSubject get activeAccount; } @@ -111,7 +135,11 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState final as = accounts.value; final aa = activeAccount.valueOrNull; if (aa?.id == account.id) { - setActiveAccount(as.firstOrNull); + if (as.firstOrNull != null) { + setActiveAccount(as.first); + } else { + activeAccount.add(null); + } } unawaited(() async { @@ -125,9 +153,8 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState } @override - void setActiveAccount(final Account? account) { - final as = accounts.value; - activeAccount.add(account ?? as.firstOrNull); + void setActiveAccount(final Account account) { + activeAccount.add(account); } @override diff --git a/packages/neon/neon/lib/src/pages/home.dart b/packages/neon/neon/lib/src/pages/home.dart index c9d23b18..553f051d 100644 --- a/packages/neon/neon/lib/src/pages/home.dart +++ b/packages/neon/neon/lib/src/pages/home.dart @@ -300,7 +300,7 @@ class _HomePageState extends State { .toList(), onChanged: (final id) { if (id != null) { - _accountsBloc.setActiveAccount(accounts.find(id)); + _accountsBloc.setActiveAccount(accounts.find(id)!); } }, ), From fbd4f6bade18809ea08f538556400bcb6082fc0e Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Mon, 5 Jun 2023 15:08:37 +0200 Subject: [PATCH 3/3] neon: add convenience methods for the active account to AccountsBloc Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> --- packages/neon/neon/lib/src/app.dart | 8 +-- .../neon/neon/lib/src/blocs/accounts.dart | 72 +++++++++++++++++-- packages/neon/neon/lib/src/blocs/apps.dart | 2 +- .../neon/lib/src/pages/account_settings.dart | 4 +- packages/neon/neon/lib/src/pages/home.dart | 4 +- .../neon/neon/lib/src/pages/settings.dart | 4 +- .../neon/lib/src/widgets/account_tile.dart | 2 +- .../neon/lib/src/widgets/user_avatar.dart | 2 +- .../neon_notifications/lib/pages/main.dart | 2 +- 9 files changed, 79 insertions(+), 21 deletions(-) diff --git a/packages/neon/neon/lib/src/app.dart b/packages/neon/neon/lib/src/app.dart index b4687d30..da3ad4ae 100644 --- a/packages/neon/neon/lib/src/app.dart +++ b/packages/neon/neon/lib/src/app.dart @@ -124,7 +124,7 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra } final app = Provider.of>(context, listen: false).find('notifications'); if (app != null) { - await _accountsBloc.getAppsBloc(account).getAppBloc(app).refresh(); + await _accountsBloc.getAppsBlocFor(account).getAppBloc(app).refresh(); } }; Global.onPushNotificationClicked = (final pushNotificationWithAccountID) async { @@ -144,7 +144,7 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra if (app != null) { if (app.id != 'notifications') { _accountsBloc - .getAppsBloc(account) + .getAppsBlocFor(account) .getAppBloc(app) .deleteNotification(pushNotificationWithAccountID.subject.nid!); } @@ -211,7 +211,7 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra } Future _openAppFromExternal(final Account account, final String id) async { - await _accountsBloc.getAppsBloc(account).setActiveApp(id); + await _accountsBloc.getAppsBlocFor(account).setActiveApp(id); _navigatorKey.currentState!.popUntil((final route) => route.settings.name == 'home'); await _showAndRestoreWindow(); } @@ -268,7 +268,7 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra FlutterNativeSplash.remove(); return ResultBuilder( stream: activeAccountSnapshot.hasData - ? widget.accountsBloc.getCapabilitiesBloc(activeAccountSnapshot.data!).capabilities + ? widget.accountsBloc.getCapabilitiesBlocFor(activeAccountSnapshot.data!).capabilities : null, builder: (final context, final capabilitiesSnapshot) { final nextcloudTheme = capabilitiesSnapshot.data?.capabilities.theming; diff --git a/packages/neon/neon/lib/src/blocs/accounts.dart b/packages/neon/neon/lib/src/blocs/accounts.dart index 8951f3f6..c667c10c 100644 --- a/packages/neon/neon/lib/src/blocs/accounts.dart +++ b/packages/neon/neon/lib/src/blocs/accounts.dart @@ -176,26 +176,65 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState setActiveAccount(account); } - AccountSpecificOptions getOptions(final Account account) => _accountsOptions[account.id] ??= AccountSpecificOptions( + /// The currently active account. + /// + /// Equivalent to activeAccount.value but throws a [StateError] when no user is logged in. + @visibleForTesting + Account get aa { + final aa = activeAccount.value; + + if (aa == null) { + throw StateError('No user is logged in.'); + } + + return aa; + } + + /// The options for the [activeAccount]. + /// + /// Convenience method for [getOptionsFor] with the currently active account. + AccountSpecificOptions get activeOptions => getOptionsFor(aa); + + /// The options for the specified [account]. + /// + /// Use [activeOptions] to get them for the [activeAccount]. + AccountSpecificOptions getOptionsFor(final Account account) => + _accountsOptions[account.id] ??= AccountSpecificOptions( AppStorage('accounts-${account.id}', _sharedPreferences), - getAppsBloc(account), + getAppsBlocFor(account), ); - AppsBloc getAppsBloc(final Account account) { + /// The appsBloc for the [activeAccount]. + /// + /// Convenience method for [getAppsBlocFor] with the currently active account. + AppsBloc get activeAppsBloc => getAppsBlocFor(aa); + + /// The appsBloc for the specified [account]. + /// + /// Use [activeAppsBloc] to get them for the [activeAccount]. + AppsBloc getAppsBlocFor(final Account account) { if (_appsBlocs[account.id] != null) { return _appsBlocs[account.id]!; } return _appsBlocs[account.id] = AppsBloc( _requestManager, - getCapabilitiesBloc(account), + getCapabilitiesBlocFor(account), this, account, _allAppImplementations, ); } - CapabilitiesBloc getCapabilitiesBloc(final Account account) { + /// The capabilitiesBloc for the [activeAccount]. + /// + /// Convenience method for [getCapabilitiesBlocFor] with the currently active account. + CapabilitiesBloc get activeCapabilitiesBloc => getCapabilitiesBlocFor(aa); + + /// The capabilitiesBloc for the specified [account]. + /// + /// Use [activeCapabilitiesBloc] to get them for the [activeAccount]. + CapabilitiesBloc getCapabilitiesBlocFor(final Account account) { if (_capabilitiesBlocs[account.id] != null) { return _capabilitiesBlocs[account.id]!; } @@ -206,7 +245,15 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState ); } - UserDetailsBloc getUserDetailsBloc(final Account account) { + /// The userDetailsBloc for the [activeAccount]. + /// + /// Convenience method for [getUserDetailsBlocFor] with the currently active account. + UserDetailsBloc get activeUerDetailsBloc => getUserDetailsBlocFor(aa); + + /// The userDetailsBloc for the specified [account]. + /// + /// Use [activeUerDetailsBloc] to get them for the [activeAccount]. + UserDetailsBloc getUserDetailsBlocFor(final Account account) { if (_userDetailsBlocs[account.id] != null) { return _userDetailsBlocs[account.id]!; } @@ -217,7 +264,15 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState ); } - UserStatusesBloc getUserStatusesBloc(final Account account) { + /// The userStatusBloc for the [activeAccount]. + /// + /// Convenience method for [getUserStatusesBlocFor] with the currently active account. + UserStatusesBloc get activeUserStatusesBloc => getUserStatusesBlocFor(aa); + + /// The userStatusBloc for the specified [account]. + /// + /// Use [activeUserStatusesBloc] to get them for the [activeAccount]. + UserStatusesBloc getUserStatusesBlocFor(final Account account) { if (_userStatusesBlocs[account.id] != null) { return _userStatusesBlocs[account.id]!; } @@ -229,6 +284,9 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState } } +/// Get a list of logged in accounts from [storage]. +/// +/// It is not checked whether the stored information is still valid. List loadAccounts(final AppStorage storage) { if (storage.containsKey(_keyAccounts)) { return storage diff --git a/packages/neon/neon/lib/src/blocs/apps.dart b/packages/neon/neon/lib/src/blocs/apps.dart index a2c799cc..5dceb6d8 100644 --- a/packages/neon/neon/lib/src/blocs/apps.dart +++ b/packages/neon/neon/lib/src/blocs/apps.dart @@ -33,7 +33,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates appImplementations.listen((final result) { if (result.data != null) { - final options = _accountsBloc.getOptions(_account); + final options = _accountsBloc.getOptionsFor(_account); unawaited( options.initialApp.stream.first.then((var initialApp) async { if (initialApp == null) { diff --git a/packages/neon/neon/lib/src/pages/account_settings.dart b/packages/neon/neon/lib/src/pages/account_settings.dart index 0b95a9f6..ea91a5ef 100644 --- a/packages/neon/neon/lib/src/pages/account_settings.dart +++ b/packages/neon/neon/lib/src/pages/account_settings.dart @@ -10,8 +10,8 @@ class AccountSettingsPage extends StatelessWidget { final AccountsBloc bloc; final Account account; - late final _options = bloc.getOptions(account); - late final _userDetailsBloc = bloc.getUserDetailsBloc(account); + late final _options = bloc.getOptionsFor(account); + late final _userDetailsBloc = bloc.getUserDetailsBlocFor(account); late final _name = account.client.humanReadableID; @override diff --git a/packages/neon/neon/lib/src/pages/home.dart b/packages/neon/neon/lib/src/pages/home.dart index 553f051d..620e6b7d 100644 --- a/packages/neon/neon/lib/src/pages/home.dart +++ b/packages/neon/neon/lib/src/pages/home.dart @@ -28,8 +28,8 @@ class _HomePageState extends State { _globalOptions = Provider.of(context, listen: false); _accountsBloc = Provider.of(context, listen: false); _account = _accountsBloc.activeAccount.value!; - _appsBloc = _accountsBloc.getAppsBloc(_account); - _capabilitiesBloc = _accountsBloc.getCapabilitiesBloc(_account); + _appsBloc = _accountsBloc.activeAppsBloc; + _capabilitiesBloc = _accountsBloc.activeCapabilitiesBloc; _appsBloc.openNotifications.listen((final _) async { final notificationsAppImplementation = _appsBloc.notificationsAppImplementation.valueOrNull; diff --git a/packages/neon/neon/lib/src/pages/settings.dart b/packages/neon/neon/lib/src/pages/settings.dart index 145d740b..efebfb80 100644 --- a/packages/neon/neon/lib/src/pages/settings.dart +++ b/packages/neon/neon/lib/src/pages/settings.dart @@ -31,7 +31,7 @@ class _SettingsPageState extends State { } for (final account in accountsBloc.accounts.value) { - await accountsBloc.getOptions(account).reset(); + await accountsBloc.getOptionsFor(account).reset(); } } }, @@ -52,7 +52,7 @@ class _SettingsPageState extends State { accountSpecificOptions: { if (accountsSnapshot.hasData) ...{ for (final account in accountsSnapshot.data!) ...{ - account: accountsBloc.getOptions(account).options, + account: accountsBloc.getOptionsFor(account).options, }, }, }, diff --git a/packages/neon/neon/lib/src/widgets/account_tile.dart b/packages/neon/neon/lib/src/widgets/account_tile.dart index 54eb5b15..5afa02c8 100644 --- a/packages/neon/neon/lib/src/widgets/account_tile.dart +++ b/packages/neon/neon/lib/src/widgets/account_tile.dart @@ -20,7 +20,7 @@ class NeonAccountTile extends StatelessWidget { @override Widget build(final BuildContext context) { - final userDetailsBloc = Provider.of(context, listen: false).getUserDetailsBloc(account); + final userDetailsBloc = Provider.of(context, listen: false).getUserDetailsBlocFor(account); return ListTile( textColor: textColor, diff --git a/packages/neon/neon/lib/src/widgets/user_avatar.dart b/packages/neon/neon/lib/src/widgets/user_avatar.dart index ce23ce3b..80ff76ee 100644 --- a/packages/neon/neon/lib/src/widgets/user_avatar.dart +++ b/packages/neon/neon/lib/src/widgets/user_avatar.dart @@ -24,7 +24,7 @@ class NeonUserAvatar extends StatefulWidget { } class _UserAvatarState extends State { - late final _userStatusBloc = Provider.of(context, listen: false).getUserStatusesBloc(widget.account); + late final _userStatusBloc = Provider.of(context, listen: false).getUserStatusesBlocFor(widget.account); late double size; @override diff --git a/packages/neon/neon_notifications/lib/pages/main.dart b/packages/neon/neon_notifications/lib/pages/main.dart index 6412354b..f647a860 100644 --- a/packages/neon/neon_notifications/lib/pages/main.dart +++ b/packages/neon/neon_notifications/lib/pages/main.dart @@ -91,7 +91,7 @@ class _NotificationsMainPageState extends State { } if (app != null) { final accountsBloc = Provider.of(context, listen: false); - await accountsBloc.getAppsBloc(accountsBloc.activeAccount.value!).setActiveApp(app.id); + await accountsBloc.activeAppsBloc.setActiveApp(app.id); } else { await showDialog( context: context,