From 3e3c3256c6d2b40bbbdbe3e78d0cee175b26c40f Mon Sep 17 00:00:00 2001 From: jld3103 Date: Fri, 30 Sep 2022 00:03:03 +0200 Subject: [PATCH] neon: Move account options --- packages/neon/lib/src/models/account.dart | 53 ------------------- packages/neon/lib/src/neon.dart | 1 + .../neon/lib/src/utils/account_options.dart | 48 +++++++++++++++++ 3 files changed, 49 insertions(+), 53 deletions(-) create mode 100644 packages/neon/lib/src/utils/account_options.dart diff --git a/packages/neon/lib/src/models/account.dart b/packages/neon/lib/src/models/account.dart index 2b2a1953..09c9cdf0 100644 --- a/packages/neon/lib/src/models/account.dart +++ b/packages/neon/lib/src/models/account.dart @@ -1,15 +1,9 @@ -import 'dart:async'; import 'dart:convert'; import 'package:crypto/crypto.dart'; import 'package:json_annotation/json_annotation.dart'; -import 'package:neon/l10n/localizations.dart'; -import 'package:neon/src/blocs/apps.dart'; -import 'package:neon/src/neon.dart'; import 'package:nextcloud/nextcloud.dart'; import 'package:package_info_plus/package_info_plus.dart'; -import 'package:rxdart/rxdart.dart'; -import 'package:settings/settings.dart'; part 'account.g.dart'; @@ -87,50 +81,3 @@ extension NextcloudClientHelpers on NextcloudClient { return '${username!}@${uri.port != 443 ? '${uri.host}:${uri.port}' : uri.host}'; } } - -class AccountSpecificOptions { - AccountSpecificOptions( - this._storage, - this._appsBloc, - ) { - _appsBloc.appImplementations.listen((final result) { - if (result.data != null) { - _appIDsSubject.add({ - null: (final context) => AppLocalizations.of(context).accountOptionsAutomatic, - for (final app in result.data!) ...{ - app.id: app.name, - }, - }); - } - }); - } - - final Storage _storage; - final AppsBloc _appsBloc; - final _appIDsSubject = BehaviorSubject>(); - - late final List