diff --git a/packages/neon/neon/lib/neon.dart b/packages/neon/neon/lib/neon.dart index 20c9cf2b..93cb201f 100644 --- a/packages/neon/neon/lib/neon.dart +++ b/packages/neon/neon/lib/neon.dart @@ -42,12 +42,10 @@ Future runNeon({ buildUserAgent(packageInfo); final globalOptions = GlobalOptions( - sharedPreferences, packageInfo, ); final accountsBloc = AccountsBloc( - sharedPreferences, globalOptions, allAppImplementations, ); @@ -58,7 +56,6 @@ Future runNeon({ } final pushNotificationsBloc = PushNotificationsBloc( accountsBloc, - sharedPreferences, globalOptions, ); final firstLaunchBloc = FirstLaunchBloc( @@ -73,9 +70,6 @@ Future runNeon({ runApp( MultiProvider( providers: [ - Provider( - create: (final _) => sharedPreferences, - ), Provider( create: (final _) => globalOptions, ), diff --git a/packages/neon/neon/lib/src/blocs/accounts.dart b/packages/neon/neon/lib/src/blocs/accounts.dart index e3f77c46..10605cea 100644 --- a/packages/neon/neon/lib/src/blocs/accounts.dart +++ b/packages/neon/neon/lib/src/blocs/accounts.dart @@ -14,7 +14,6 @@ import 'package:neon/src/settings/models/storage.dart'; import 'package:neon/src/utils/account_options.dart'; import 'package:neon/src/utils/global_options.dart'; import 'package:rxdart/rxdart.dart'; -import 'package:shared_preferences/shared_preferences.dart'; const _keyAccounts = 'accounts'; @@ -56,7 +55,6 @@ abstract interface class AccountsBlocStates { class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocStates { AccountsBloc( - this._sharedPreferences, this._globalOptions, this._allAppImplementations, ) { @@ -97,7 +95,6 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState } late final AppStorage _storage = AppStorage('accounts'); - final SharedPreferences _sharedPreferences; final GlobalOptions _globalOptions; final Iterable _allAppImplementations; final _keyLastUsedAccount = 'last-used-account'; diff --git a/packages/neon/neon/lib/src/blocs/push_notifications.dart b/packages/neon/neon/lib/src/blocs/push_notifications.dart index ae61b769..c25a71f1 100644 --- a/packages/neon/neon/lib/src/blocs/push_notifications.dart +++ b/packages/neon/neon/lib/src/blocs/push_notifications.dart @@ -13,7 +13,6 @@ import 'package:neon/src/settings/models/storage.dart'; import 'package:neon/src/utils/global_options.dart'; import 'package:neon/src/utils/push_utils.dart'; import 'package:nextcloud/nextcloud.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import 'package:unifiedpush/unifiedpush.dart'; abstract class PushNotificationsBlocEvents {} @@ -26,7 +25,6 @@ abstract class PushNotificationsBlocStates { class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents, PushNotificationsBlocStates { PushNotificationsBloc( this._accountsBloc, - this._sharedPreferences, this._globalOptions, ) { if (NeonPlatform.instance.canUsePushNotifications) { @@ -39,7 +37,6 @@ class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents, } final AccountsBloc _accountsBloc; - final SharedPreferences _sharedPreferences; late final _storage = AppStorage(AppIDs.notifications); final GlobalOptions _globalOptions; diff --git a/packages/neon/neon/lib/src/utils/global_options.dart b/packages/neon/neon/lib/src/utils/global_options.dart index 70aa436a..d6b319f1 100644 --- a/packages/neon/neon/lib/src/utils/global_options.dart +++ b/packages/neon/neon/lib/src/utils/global_options.dart @@ -11,7 +11,6 @@ import 'package:neon/src/settings/models/storage.dart'; import 'package:neon/src/settings/models/toggle_option.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:shared_preferences/shared_preferences.dart'; const unifiedPushNextPushID = 'org.unifiedpush.distributor.nextpush'; @@ -19,7 +18,6 @@ const unifiedPushNextPushID = 'org.unifiedpush.distributor.nextpush'; @immutable class GlobalOptions { GlobalOptions( - this._sharedPreferences, this._packageInfo, ) { pushNotificationsEnabled.addListener(_pushNotificationsEnabledListener); @@ -51,7 +49,6 @@ class GlobalOptions { } } - final SharedPreferences _sharedPreferences; late final AppStorage _storage = AppStorage('global'); final PackageInfo _packageInfo; diff --git a/packages/neon/neon/lib/src/utils/push_utils.dart b/packages/neon/neon/lib/src/utils/push_utils.dart index 302a75be..1588dbce 100644 --- a/packages/neon/neon/lib/src/utils/push_utils.dart +++ b/packages/neon/neon/lib/src/utils/push_utils.dart @@ -18,7 +18,6 @@ import 'package:neon/src/theme/colors.dart'; import 'package:neon/src/utils/global.dart'; import 'package:neon/src/utils/localizations.dart'; import 'package:nextcloud/nextcloud.dart'; -import 'package:shared_preferences/shared_preferences.dart'; @internal @immutable