From 0be6026afca0416d394341ce475e4c969d067ff8 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Fri, 6 Oct 2023 08:38:16 +0200 Subject: [PATCH] refactor(app,neon,neon_files,neon_news,neon_notes,neon_notifications): Use named imports Signed-off-by: jld3103 --- .../app/integration_test/screenshot_test.dart | 6 +++- packages/app/pubspec.lock | 2 +- packages/app/pubspec.yaml | 4 +++ packages/neon/neon/lib/nextcloud.dart | 1 - packages/neon/neon/lib/src/app.dart | 3 +- .../neon/neon/lib/src/blocs/accounts.dart | 2 +- packages/neon/neon/lib/src/blocs/apps.dart | 5 +-- .../neon/neon/lib/src/blocs/capabilities.dart | 6 ++-- .../lib/src/blocs/login_check_account.dart | 1 + .../src/blocs/login_check_server_status.dart | 5 +-- .../neon/neon/lib/src/blocs/login_flow.dart | 11 +++--- .../neon/neon/lib/src/blocs/next_push.dart | 2 +- .../lib/src/blocs/push_notifications.dart | 4 +-- .../neon/lib/src/blocs/unified_search.dart | 24 ++++++------- .../neon/neon/lib/src/blocs/user_details.dart | 6 ++-- .../neon/lib/src/blocs/user_statuses.dart | 13 +++---- .../lib/src/models/app_implementation.dart | 4 +-- .../lib/src/models/push_notification.dart | 4 +-- .../lib/src/models/push_notification.g.dart | 2 +- .../neon/lib/src/pages/account_settings.dart | 4 +-- packages/neon/neon/lib/src/pages/home.dart | 2 +- .../src/pages/login_check_server_status.dart | 6 ++-- packages/neon/neon/lib/src/theme/theme.dart | 4 +-- .../neon/neon/lib/src/utils/push_utils.dart | 14 ++++---- .../neon/lib/src/widgets/account_tile.dart | 4 +-- .../neon/neon/lib/src/widgets/drawer.dart | 4 +-- .../src/widgets/unified_search_results.dart | 12 +++---- .../neon/lib/src/widgets/user_avatar.dart | 5 +-- packages/neon/neon_files/lib/neon_files.dart | 5 +-- packages/neon/neon_files/lib/routes.dart | 2 +- packages/neon/neon_files/pubspec.yaml | 4 +++ .../neon/neon_news/lib/blocs/article.dart | 2 +- .../neon/neon_news/lib/blocs/articles.dart | 34 +++++++++---------- packages/neon/neon_news/lib/blocs/news.dart | 22 ++++++------ .../neon/neon_news/lib/dialogs/add_feed.dart | 4 +-- .../neon_news/lib/dialogs/feed_show_url.dart | 2 +- .../lib/dialogs/feed_update_error.dart | 2 +- .../neon/neon_news/lib/dialogs/move_feed.dart | 6 ++-- packages/neon/neon_news/lib/neon_news.dart | 6 ++-- packages/neon/neon_news/lib/pages/feed.dart | 2 +- packages/neon/neon_news/lib/pages/folder.dart | 2 +- packages/neon/neon_news/lib/routes.dart | 2 +- .../neon/neon_news/lib/sort/articles.dart | 2 +- packages/neon/neon_news/lib/sort/feeds.dart | 2 +- packages/neon/neon_news/lib/sort/folders.dart | 2 +- .../neon_news/lib/widgets/articles_view.dart | 10 +++--- .../neon/neon_news/lib/widgets/feed_icon.dart | 2 +- .../neon_news/lib/widgets/feeds_view.dart | 10 +++--- .../neon_news/lib/widgets/folder_select.dart | 10 +++--- .../neon_news/lib/widgets/folder_view.dart | 2 +- .../neon_news/lib/widgets/folders_view.dart | 4 +-- packages/neon/neon_news/pubspec.yaml | 4 +++ packages/neon/neon_notes/lib/blocs/note.dart | 6 ++-- packages/neon/neon_notes/lib/blocs/notes.dart | 12 +++---- .../neon_notes/lib/dialogs/create_note.dart | 4 +-- .../lib/dialogs/select_category.dart | 4 +-- packages/neon/neon_notes/lib/neon_notes.dart | 6 ++-- packages/neon/neon_notes/lib/routes.dart | 2 +- packages/neon/neon_notes/lib/sort/notes.dart | 2 +- .../lib/widgets/categories_view.dart | 4 +-- .../neon_notes/lib/widgets/notes_view.dart | 16 +++++---- packages/neon/neon_notes/pubspec.yaml | 4 +++ .../lib/blocs/notifications.dart | 16 ++++----- .../lib/neon_notifications.dart | 6 ++-- .../neon_notifications/lib/pages/main.dart | 6 ++-- .../neon/neon_notifications/lib/routes.dart | 2 +- packages/neon/neon_notifications/pubspec.yaml | 4 +++ 67 files changed, 218 insertions(+), 179 deletions(-) delete mode 100644 packages/neon/neon/lib/nextcloud.dart diff --git a/packages/app/integration_test/screenshot_test.dart b/packages/app/integration_test/screenshot_test.dart index 86f83251..ca0078d4 100644 --- a/packages/app/integration_test/screenshot_test.dart +++ b/packages/app/integration_test/screenshot_test.dart @@ -9,9 +9,13 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:neon/models.dart'; import 'package:neon/neon.dart'; -import 'package:neon/nextcloud.dart'; import 'package:neon/settings.dart'; import 'package:neon_files/widgets/actions.dart'; +import 'package:nextcloud/core.dart' as core; +import 'package:nextcloud/news.dart' as news; +import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/notes.dart' as notes; +import 'package:nextcloud/notifications.dart' as notifications; import 'package:shared_preferences/shared_preferences.dart'; Future runTestApp( diff --git a/packages/app/pubspec.lock b/packages/app/pubspec.lock index cfb3d441..a5d9b81e 100644 --- a/packages/app/pubspec.lock +++ b/packages/app/pubspec.lock @@ -653,7 +653,7 @@ packages: source: hosted version: "1.0.0" nextcloud: - dependency: "direct overridden" + dependency: "direct dev" description: path: "../nextcloud" relative: true diff --git a/packages/app/pubspec.yaml b/packages/app/pubspec.yaml index c9d133a5..9c63b44a 100644 --- a/packages/app/pubspec.yaml +++ b/packages/app/pubspec.yaml @@ -41,6 +41,10 @@ dev_dependencies: git: url: https://github.com/nextcloud/neon path: packages/neon_lints + nextcloud: + git: + url: https://github.com/nextcloud/neon + path: packages/nextcloud shared_preferences: any vector_graphics_compiler: any diff --git a/packages/neon/neon/lib/nextcloud.dart b/packages/neon/neon/lib/nextcloud.dart deleted file mode 100644 index ec6929ce..00000000 --- a/packages/neon/neon/lib/nextcloud.dart +++ /dev/null @@ -1 +0,0 @@ -export 'package:nextcloud/nextcloud.dart'; diff --git a/packages/neon/neon/lib/src/app.dart b/packages/neon/neon/lib/src/app.dart index 293d83fc..b367b4ad 100644 --- a/packages/neon/neon/lib/src/app.dart +++ b/packages/neon/neon/lib/src/app.dart @@ -22,6 +22,7 @@ import 'package:neon/src/utils/global_options.dart'; import 'package:neon/src/utils/localizations.dart'; import 'package:neon/src/utils/provider.dart'; import 'package:neon/src/utils/push_utils.dart'; +import 'package:nextcloud/core.dart' as core; import 'package:nextcloud/nextcloud.dart'; import 'package:quick_actions/quick_actions.dart'; import 'package:tray_manager/tray_manager.dart' as tray; @@ -284,7 +285,7 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra stream: _accountsBloc.activeAccount, builder: (final context, final activeAccountSnapshot) { FlutterNativeSplash.remove(); - return ResultBuilder.behaviorSubject( + return ResultBuilder.behaviorSubject( stream: activeAccountSnapshot.hasData ? _accountsBloc.getCapabilitiesBlocFor(activeAccountSnapshot.data!).capabilities : null, diff --git a/packages/neon/neon/lib/src/blocs/accounts.dart b/packages/neon/neon/lib/src/blocs/accounts.dart index e6304d20..91e085e9 100644 --- a/packages/neon/neon/lib/src/blocs/accounts.dart +++ b/packages/neon/neon/lib/src/blocs/accounts.dart @@ -16,7 +16,7 @@ import 'package:neon/src/models/app_implementation.dart'; 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:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; import 'package:rxdart/rxdart.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 77f2cdc3..5bf324c3 100644 --- a/packages/neon/neon/lib/src/blocs/apps.dart +++ b/packages/neon/neon/lib/src/blocs/apps.dart @@ -11,6 +11,7 @@ import 'package:neon/src/models/app_implementation.dart'; import 'package:neon/src/models/notifications_interface.dart'; import 'package:neon/src/settings/models/options_collection.dart'; import 'package:neon/src/utils/request_manager.dart'; +import 'package:nextcloud/core.dart' as core; import 'package:nextcloud/nextcloud.dart'; import 'package:provider/provider.dart'; import 'package:rxdart/rxdart.dart'; @@ -26,7 +27,7 @@ abstract interface class AppsBlocEvents { @internal abstract interface class AppsBlocStates { - BehaviorSubject>> get apps; + BehaviorSubject>> get apps; BehaviorSubject>> get appImplementations; @@ -182,7 +183,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates BehaviorSubject(); @override - BehaviorSubject>> apps = BehaviorSubject(); + BehaviorSubject>> apps = BehaviorSubject(); @override BehaviorSubject> notificationsAppImplementation = BehaviorSubject(); diff --git a/packages/neon/neon/lib/src/blocs/capabilities.dart b/packages/neon/neon/lib/src/blocs/capabilities.dart index e55ae135..6b01bcd5 100644 --- a/packages/neon/neon/lib/src/blocs/capabilities.dart +++ b/packages/neon/neon/lib/src/blocs/capabilities.dart @@ -5,7 +5,7 @@ import 'package:neon/src/bloc/bloc.dart'; import 'package:neon/src/bloc/result.dart'; import 'package:neon/src/models/account.dart'; import 'package:neon/src/utils/request_manager.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; import 'package:rxdart/rxdart.dart'; @internal @@ -13,7 +13,7 @@ abstract interface class CapabilitiesBlocEvents {} @internal abstract interface class CapabilitiesBlocStates { - BehaviorSubject> get capabilities; + BehaviorSubject> get capabilities; } @internal @@ -33,7 +33,7 @@ class CapabilitiesBloc extends InteractiveBloc implements CapabilitiesBlocEvents } @override - BehaviorSubject> capabilities = BehaviorSubject(); + BehaviorSubject> capabilities = BehaviorSubject(); @override Future refresh() async { diff --git a/packages/neon/neon/lib/src/blocs/login_check_account.dart b/packages/neon/neon/lib/src/blocs/login_check_account.dart index 1d1b7bf0..47a2e2b9 100644 --- a/packages/neon/neon/lib/src/blocs/login_check_account.dart +++ b/packages/neon/neon/lib/src/blocs/login_check_account.dart @@ -7,6 +7,7 @@ import 'package:neon/src/bloc/result.dart'; import 'package:neon/src/models/account.dart'; import 'package:neon/src/utils/user_agent.dart'; import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/provisioning_api.dart' as provisioning_api; import 'package:rxdart/rxdart.dart'; @internal diff --git a/packages/neon/neon/lib/src/blocs/login_check_server_status.dart b/packages/neon/neon/lib/src/blocs/login_check_server_status.dart index 73a42f57..1d62e1cc 100644 --- a/packages/neon/neon/lib/src/blocs/login_check_server_status.dart +++ b/packages/neon/neon/lib/src/blocs/login_check_server_status.dart @@ -5,6 +5,7 @@ import 'package:meta/meta.dart'; import 'package:neon/src/bloc/bloc.dart'; import 'package:neon/src/bloc/result.dart'; import 'package:neon/src/utils/user_agent.dart'; +import 'package:nextcloud/core.dart' as core; import 'package:nextcloud/nextcloud.dart'; import 'package:rxdart/rxdart.dart'; @@ -14,7 +15,7 @@ abstract interface class LoginCheckServerStatusBlocEvents {} @internal abstract interface class LoginCheckServerStatusBlocStates { /// Contains the current server connection state - BehaviorSubject> get state; + BehaviorSubject> get state; } @internal @@ -34,7 +35,7 @@ class LoginCheckServerStatusBloc extends InteractiveBloc } @override - BehaviorSubject> state = BehaviorSubject(); + BehaviorSubject> state = BehaviorSubject(); @override Future refresh() async { diff --git a/packages/neon/neon/lib/src/blocs/login_flow.dart b/packages/neon/neon/lib/src/blocs/login_flow.dart index 6b9f8eec..1166d710 100644 --- a/packages/neon/neon/lib/src/blocs/login_flow.dart +++ b/packages/neon/neon/lib/src/blocs/login_flow.dart @@ -5,6 +5,7 @@ import 'package:meta/meta.dart'; import 'package:neon/src/bloc/bloc.dart'; import 'package:neon/src/bloc/result.dart'; import 'package:neon/src/utils/user_agent.dart'; +import 'package:nextcloud/core.dart' as core; import 'package:nextcloud/nextcloud.dart'; import 'package:rxdart/rxdart.dart'; @@ -13,9 +14,9 @@ abstract interface class LoginFlowBlocEvents {} @internal abstract interface class LoginFlowBlocStates { - BehaviorSubject> get init; + BehaviorSubject> get init; - Stream get result; + Stream get result; } @internal @@ -29,7 +30,7 @@ class LoginFlowBloc extends InteractiveBloc implements LoginFlowBlocEvents, Logi serverURL, userAgentOverride: neonUserAgent, ); - final _resultController = StreamController(); + final _resultController = StreamController(); Timer? _pollTimer; @@ -43,10 +44,10 @@ class LoginFlowBloc extends InteractiveBloc implements LoginFlowBlocEvents, Logi } @override - BehaviorSubject> init = BehaviorSubject(); + BehaviorSubject> init = BehaviorSubject(); @override - late Stream result = _resultController.stream.asBroadcastStream(); + late Stream result = _resultController.stream.asBroadcastStream(); @override Future refresh() async { diff --git a/packages/neon/neon/lib/src/blocs/next_push.dart b/packages/neon/neon/lib/src/blocs/next_push.dart index 04351230..542babb1 100644 --- a/packages/neon/neon/lib/src/blocs/next_push.dart +++ b/packages/neon/neon/lib/src/blocs/next_push.dart @@ -6,7 +6,7 @@ import 'package:neon/src/bloc/bloc.dart'; import 'package:neon/src/blocs/accounts.dart'; import 'package:neon/src/models/account.dart'; import 'package:neon/src/utils/global_options.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/uppush.dart' as uppush; import 'package:rxdart/rxdart.dart'; @internal diff --git a/packages/neon/neon/lib/src/blocs/push_notifications.dart b/packages/neon/neon/lib/src/blocs/push_notifications.dart index d8115d2a..d4715cd7 100644 --- a/packages/neon/neon/lib/src/blocs/push_notifications.dart +++ b/packages/neon/neon/lib/src/blocs/push_notifications.dart @@ -10,7 +10,7 @@ import 'package:neon/src/platform/platform.dart'; 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:nextcloud/notifications.dart' as notifications; import 'package:unifiedpush/unifiedpush.dart'; @internal @@ -80,7 +80,7 @@ class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents, debugPrint('Registering account $instance for push notifications on $endpoint'); final subscription = await account.client.notifications.push.registerDevice( - pushTokenHash: generatePushTokenHash(endpoint), + pushTokenHash: notifications.generatePushTokenHash(endpoint), devicePublicKey: keypair.publicKey.toFormattedPEM(), proxyServer: '$endpoint#', // This is a hack to make the Nextcloud server directly push to the endpoint ); diff --git a/packages/neon/neon/lib/src/blocs/unified_search.dart b/packages/neon/neon/lib/src/blocs/unified_search.dart index e99933ab..3be1cb50 100644 --- a/packages/neon/neon/lib/src/blocs/unified_search.dart +++ b/packages/neon/neon/lib/src/blocs/unified_search.dart @@ -7,7 +7,7 @@ import 'package:neon/models.dart'; import 'package:neon/src/bloc/bloc.dart'; import 'package:neon/src/bloc/result.dart'; import 'package:neon/src/blocs/apps.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; import 'package:rxdart/rxdart.dart'; @internal @@ -23,7 +23,7 @@ abstract interface class UnifiedSearchBlocEvents { abstract interface class UnifiedSearchBlocStates { BehaviorSubject get enabled; - BehaviorSubject>?>> get results; + BehaviorSubject>?>> get results; } @internal @@ -47,7 +47,7 @@ class UnifiedSearchBloc extends InteractiveBloc implements UnifiedSearchBlocEven BehaviorSubject enabled = BehaviorSubject.seeded(false); @override - BehaviorSubject>?>> results = + BehaviorSubject>?>> results = BehaviorSubject.seeded(Result.success(null)); @override @@ -103,15 +103,15 @@ class UnifiedSearchBloc extends InteractiveBloc implements UnifiedSearchBlocEven } } - Iterable>> _getLoadingProviders( - final Iterable providers, + Iterable>> _getLoadingProviders( + final Iterable providers, ) sync* { for (final provider in providers) { yield MapEntry(provider, Result.loading()); } } - Future _searchProvider(final CoreUnifiedSearchProvider provider) async { + Future _searchProvider(final core.UnifiedSearchProvider provider) async { _updateResults(provider, Result.loading()); try { final response = await _account.client.core.unifiedSearch.search( @@ -126,7 +126,7 @@ class UnifiedSearchBloc extends InteractiveBloc implements UnifiedSearchBlocEven } } - void _updateResults(final CoreUnifiedSearchProvider provider, final Result result) => + void _updateResults(final core.UnifiedSearchProvider provider, final Result result) => results.add( Result.success( Map.fromEntries( @@ -138,8 +138,8 @@ class UnifiedSearchBloc extends InteractiveBloc implements UnifiedSearchBlocEven ), ); - Iterable>> _sortResults( - final Map> results, + Iterable>> _sortResults( + final Map> results, ) sync* { final activeApp = _appsBloc.activeApp.value; @@ -152,12 +152,12 @@ class UnifiedSearchBloc extends InteractiveBloc implements UnifiedSearchBlocEven .sorted((final a, final b) => _sortEntriesCount(a.value, b.value)); } - bool _providerMatchesApp(final CoreUnifiedSearchProvider provider, final AppImplementation app) => + bool _providerMatchesApp(final core.UnifiedSearchProvider provider, final AppImplementation app) => provider.id == app.id || provider.id.startsWith('${app.id}_'); - bool _hasEntries(final Result result) => + bool _hasEntries(final Result result) => !result.hasData || result.requireData.entries.isNotEmpty; - int _sortEntriesCount(final Result a, final Result b) => + int _sortEntriesCount(final Result a, final Result b) => (b.data?.entries.length ?? 0).compareTo(a.data?.entries.length ?? 0); } diff --git a/packages/neon/neon/lib/src/blocs/user_details.dart b/packages/neon/neon/lib/src/blocs/user_details.dart index 2dd3c94c..7e1eb8e7 100644 --- a/packages/neon/neon/lib/src/blocs/user_details.dart +++ b/packages/neon/neon/lib/src/blocs/user_details.dart @@ -5,7 +5,7 @@ import 'package:neon/src/bloc/bloc.dart'; import 'package:neon/src/bloc/result.dart'; import 'package:neon/src/models/account.dart'; import 'package:neon/src/utils/request_manager.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/provisioning_api.dart' as provisioning_api; import 'package:rxdart/rxdart.dart'; @internal @@ -13,7 +13,7 @@ abstract interface class UserDetailsBlocEvents {} @internal abstract interface class UserDetailsBlocStates { - BehaviorSubject> get userDetails; + BehaviorSubject> get userDetails; } @internal @@ -33,7 +33,7 @@ class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents, } @override - BehaviorSubject> userDetails = BehaviorSubject(); + BehaviorSubject> userDetails = BehaviorSubject(); @override Future refresh() async { diff --git a/packages/neon/neon/lib/src/blocs/user_statuses.dart b/packages/neon/neon/lib/src/blocs/user_statuses.dart index 00715989..7d29cfd1 100644 --- a/packages/neon/neon/lib/src/blocs/user_statuses.dart +++ b/packages/neon/neon/lib/src/blocs/user_statuses.dart @@ -8,6 +8,7 @@ import 'package:neon/src/bloc/result.dart'; import 'package:neon/src/blocs/timer.dart'; import 'package:neon/src/models/account.dart'; import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/user_status.dart' as user_status; import 'package:rxdart/rxdart.dart'; import 'package:window_manager/window_manager.dart'; @@ -18,7 +19,7 @@ abstract interface class UserStatusesBlocEvents { @internal abstract interface class UserStatusesBlocStates { - BehaviorSubject>> get statuses; + BehaviorSubject>> get statuses; } @internal @@ -41,7 +42,7 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents } @override - BehaviorSubject>> statuses = BehaviorSubject(); + BehaviorSubject>> statuses = BehaviorSubject(); @override Future refresh() async { @@ -59,7 +60,7 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents try { _updateStatus(username, Result.loading()); - UserStatusPublicInterface? data; + user_status.PublicInterface? data; if (_account.username == username) { var isAway = false; @@ -98,10 +99,10 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents } } - Map> get _statuses => - statuses.valueOrNull ?? >{}; + Map> get _statuses => + statuses.valueOrNull ?? >{}; - void _updateStatus(final String username, final Result result) { + void _updateStatus(final String username, final Result result) { statuses.add({ ..._statuses, username: result, diff --git a/packages/neon/neon/lib/src/models/app_implementation.dart b/packages/neon/neon/lib/src/models/app_implementation.dart index 0f5e14e0..6679a187 100644 --- a/packages/neon/neon/lib/src/models/app_implementation.dart +++ b/packages/neon/neon/lib/src/models/app_implementation.dart @@ -14,7 +14,7 @@ import 'package:neon/src/settings/models/options_collection.dart'; import 'package:neon/src/settings/models/storage.dart'; import 'package:neon/src/utils/provider.dart'; import 'package:neon/src/widgets/drawer_destination.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; import 'package:provider/provider.dart'; import 'package:rxdart/rxdart.dart'; import 'package:vector_graphics/vector_graphics.dart'; @@ -45,7 +45,7 @@ abstract class AppImplementation /// The first value of the record is the supported status and the second value is the supported minimum version. FutureOr<(bool? supported, String? minimumVersion)> isSupported( final Account account, - final CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities, + final core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities, ); final blocsCache = AccountCache(); diff --git a/packages/neon/neon/lib/src/models/push_notification.dart b/packages/neon/neon/lib/src/models/push_notification.dart index d7857f0c..ee6f30ec 100644 --- a/packages/neon/neon/lib/src/models/push_notification.dart +++ b/packages/neon/neon/lib/src/models/push_notification.dart @@ -1,6 +1,6 @@ import 'package:json_annotation/json_annotation.dart'; import 'package:meta/meta.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/notifications.dart' show DecryptedSubject; part 'push_notification.g.dart'; @@ -24,5 +24,5 @@ class PushNotification { final String type; - final NotificationsDecryptedSubject subject; + final DecryptedSubject subject; } diff --git a/packages/neon/neon/lib/src/models/push_notification.g.dart b/packages/neon/neon/lib/src/models/push_notification.g.dart index 6cf4b31f..a0e87f5d 100644 --- a/packages/neon/neon/lib/src/models/push_notification.g.dart +++ b/packages/neon/neon/lib/src/models/push_notification.g.dart @@ -10,7 +10,7 @@ PushNotification _$PushNotificationFromJson(Map json) => PushNo accountID: json['accountID'] as String, priority: json['priority'] as String, type: json['type'] as String, - subject: NotificationsDecryptedSubject.fromJson(json['subject'] as Map), + subject: DecryptedSubject.fromJson(json['subject'] as Map), ); Map _$PushNotificationToJson(PushNotification instance) => { diff --git a/packages/neon/neon/lib/src/pages/account_settings.dart b/packages/neon/neon/lib/src/pages/account_settings.dart index bcb694e9..588cdf66 100644 --- a/packages/neon/neon/lib/src/pages/account_settings.dart +++ b/packages/neon/neon/lib/src/pages/account_settings.dart @@ -15,7 +15,7 @@ import 'package:neon/src/theme/dialog.dart'; import 'package:neon/src/utils/confirmation_dialog.dart'; import 'package:neon/src/widgets/error.dart'; import 'package:neon/src/widgets/linear_progress_indicator.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/provisioning_api.dart' as provisioning_api; @internal class AccountSettingsPage extends StatelessWidget { @@ -77,7 +77,7 @@ class AccountSettingsPage extends StatelessWidget { ], ); - final body = ResultBuilder.behaviorSubject( + final body = ResultBuilder.behaviorSubject( stream: userDetailsBloc.userDetails, builder: (final context, final userDetails) => SettingsList( categories: [ diff --git a/packages/neon/neon/lib/src/pages/home.dart b/packages/neon/neon/lib/src/pages/home.dart index aa020935..1ffb763e 100644 --- a/packages/neon/neon/lib/src/pages/home.dart +++ b/packages/neon/neon/lib/src/pages/home.dart @@ -16,7 +16,7 @@ import 'package:neon/src/widgets/app_bar.dart'; import 'package:neon/src/widgets/drawer.dart'; import 'package:neon/src/widgets/error.dart'; import 'package:neon/src/widgets/unified_search_results.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; import 'package:provider/provider.dart'; @internal diff --git a/packages/neon/neon/lib/src/pages/login_check_server_status.dart b/packages/neon/neon/lib/src/pages/login_check_server_status.dart index c9af2a0c..b9bd5594 100644 --- a/packages/neon/neon/lib/src/pages/login_check_server_status.dart +++ b/packages/neon/neon/lib/src/pages/login_check_server_status.dart @@ -8,7 +8,7 @@ import 'package:neon/src/router.dart'; import 'package:neon/src/theme/dialog.dart'; import 'package:neon/src/widgets/error.dart'; import 'package:neon/src/widgets/validation_tile.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; @internal class LoginCheckServerStatusPage extends StatefulWidget { @@ -105,7 +105,7 @@ class _LoginCheckServerStatusPageState extends State } } - Widget _buildServerVersionTile(final Result result) { + Widget _buildServerVersionTile(final Result result) { if (result.hasError) { return NeonValidationTile( title: AppLocalizations.of(context).loginCheckingServerVersion, @@ -133,7 +133,7 @@ class _LoginCheckServerStatusPageState extends State ); } - Widget _buildMaintenanceModeTile(final Result result) { + Widget _buildMaintenanceModeTile(final Result result) { if (result.hasError) { return NeonValidationTile( title: AppLocalizations.of(context).loginCheckingMaintenanceMode, diff --git a/packages/neon/neon/lib/src/theme/theme.dart b/packages/neon/neon/lib/src/theme/theme.dart index 3bed297e..a2692d61 100644 --- a/packages/neon/neon/lib/src/theme/theme.dart +++ b/packages/neon/neon/lib/src/theme/theme.dart @@ -3,7 +3,7 @@ import 'package:meta/meta.dart'; import 'package:neon/src/theme/colors.dart'; import 'package:neon/src/theme/neon.dart'; import 'package:neon/src/utils/hex_color.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; @internal @immutable @@ -16,7 +16,7 @@ class AppTheme { this.appThemes, }) : keepOriginalAccentColor = nextcloudTheme == null || keepOriginalAccentColor; - final CoreThemingPublicCapabilities_Theming? nextcloudTheme; + final core.ThemingPublicCapabilities_Theming? nextcloudTheme; final bool keepOriginalAccentColor; final bool oledAsDark; final Iterable? appThemes; diff --git a/packages/neon/neon/lib/src/utils/push_utils.dart b/packages/neon/neon/lib/src/utils/push_utils.dart index 49a99188..92c2e976 100644 --- a/packages/neon/neon/lib/src/utils/push_utils.dart +++ b/packages/neon/neon/lib/src/utils/push_utils.dart @@ -16,26 +16,26 @@ import 'package:neon/src/settings/models/storage.dart'; 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:nextcloud/notifications.dart' as notifications; @internal @immutable class PushUtils { const PushUtils._(); - static Future loadRSAKeypair() async { + static Future loadRSAKeypair() async { const storage = AppStorage(StorageKeys.notifications); const keyDevicePrivateKey = 'device-private-key'; - late RSAKeypair keypair; + late notifications.RSAKeypair keypair; if (!storage.containsKey(keyDevicePrivateKey) || (storage.getString(keyDevicePrivateKey)?.isEmpty ?? true)) { debugPrint('Generating RSA keys for push notifications'); // The key size has to be 2048, other sizes are not accepted by Nextcloud (at the moment at least) // ignore: avoid_redundant_argument_values - keypair = RSAKeypair.fromRandom(keySize: 2048); + keypair = notifications.RSAKeypair.fromRandom(keySize: 2048); await storage.setString(keyDevicePrivateKey, keypair.privateKey.toPEM()); } else { - keypair = RSAKeypair(RSAPrivateKey.fromPEM(storage.getString(keyDevicePrivateKey)!)); + keypair = notifications.RSAKeypair(notifications.RSAPrivateKey.fromPEM(storage.getString(keyDevicePrivateKey)!)); } return keypair; @@ -82,7 +82,7 @@ class PushUtils { accountID: instance, priority: data['priority']! as String, type: data['type']! as String, - subject: decryptPushNotificationSubject(keypair.privateKey, data['subject']! as String), + subject: notifications.decryptPushNotificationSubject(keypair.privateKey, data['subject']! as String), ); if (pushNotification.subject.delete ?? false) { @@ -97,7 +97,7 @@ class PushUtils { final accounts = loadAccounts(); Account? account; - NotificationsNotification? notification; + notifications.Notification? notification; AndroidBitmap? largeIconBitmap; try { account = accounts.tryFind(instance); diff --git a/packages/neon/neon/lib/src/widgets/account_tile.dart b/packages/neon/neon/lib/src/widgets/account_tile.dart index 559dc1b9..365a745a 100644 --- a/packages/neon/neon/lib/src/widgets/account_tile.dart +++ b/packages/neon/neon/lib/src/widgets/account_tile.dart @@ -7,7 +7,7 @@ import 'package:neon/src/utils/provider.dart'; import 'package:neon/src/widgets/error.dart'; import 'package:neon/src/widgets/linear_progress_indicator.dart'; import 'package:neon/src/widgets/user_avatar.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/provisioning_api.dart' as provisioning_api; @internal class NeonAccountTile extends StatelessWidget { @@ -50,7 +50,7 @@ class NeonAccountTile extends StatelessWidget { showStatus: showStatus, ), trailing: trailing, - title: ResultBuilder.behaviorSubject( + title: ResultBuilder.behaviorSubject( stream: userDetailsBloc.userDetails, builder: (final context, final userDetails) => Row( children: [ diff --git a/packages/neon/neon/lib/src/widgets/drawer.dart b/packages/neon/neon/lib/src/widgets/drawer.dart index 827990ce..3d8e5b40 100644 --- a/packages/neon/neon/lib/src/widgets/drawer.dart +++ b/packages/neon/neon/lib/src/widgets/drawer.dart @@ -13,7 +13,7 @@ import 'package:neon/src/widgets/drawer_destination.dart'; import 'package:neon/src/widgets/error.dart'; import 'package:neon/src/widgets/image.dart'; import 'package:neon/src/widgets/linear_progress_indicator.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; @internal class NeonDrawer extends StatelessWidget { @@ -121,7 +121,7 @@ class NeonDrawerHeader extends StatelessWidget { final accountsBloc = NeonProvider.of(context); final capabilitiesBloc = accountsBloc.activeCapabilitiesBloc; - final branding = ResultBuilder.behaviorSubject( + final branding = ResultBuilder.behaviorSubject( stream: capabilitiesBloc.capabilities, builder: (final context, final capabilities) { if (!capabilities.hasData) { diff --git a/packages/neon/neon/lib/src/widgets/unified_search_results.dart b/packages/neon/neon/lib/src/widgets/unified_search_results.dart index 06d8d3fd..4f93e4a3 100644 --- a/packages/neon/neon/lib/src/widgets/unified_search_results.dart +++ b/packages/neon/neon/lib/src/widgets/unified_search_results.dart @@ -14,7 +14,7 @@ import 'package:neon/src/widgets/image.dart'; import 'package:neon/src/widgets/linear_progress_indicator.dart'; import 'package:neon/src/widgets/list_view.dart'; import 'package:neon/src/widgets/server_icon.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; @internal class NeonUnifiedSearchResults extends StatelessWidget { @@ -59,10 +59,10 @@ class NeonUnifiedSearchResults extends StatelessWidget { final BuildContext context, final AccountsBloc accountsBloc, final UnifiedSearchBloc bloc, - final CoreUnifiedSearchProvider provider, - final Result result, + final core.UnifiedSearchProvider provider, + final Result result, ) { - final entries = result.data?.entries ?? []; + final entries = result.data?.entries ?? []; return Card( child: Container( padding: const EdgeInsets.all(10), @@ -108,7 +108,7 @@ class NeonUnifiedSearchResults extends StatelessWidget { ); } - Widget _buildThumbnail(final BuildContext context, final Account account, final CoreUnifiedSearchResultEntry entry) { + Widget _buildThumbnail(final BuildContext context, final Account account, final core.UnifiedSearchResultEntry entry) { if (entry.thumbnailUrl.isNotEmpty) { return NeonCachedImage.url( size: const Size.square(largeIconSize), @@ -125,7 +125,7 @@ class NeonUnifiedSearchResults extends StatelessWidget { Widget? _buildFallbackIcon( final BuildContext context, final Account account, - final CoreUnifiedSearchResultEntry entry, + final core.UnifiedSearchResultEntry entry, ) { if (entry.icon.startsWith('/')) { return NeonCachedImage.url( diff --git a/packages/neon/neon/lib/src/widgets/user_avatar.dart b/packages/neon/neon/lib/src/widgets/user_avatar.dart index 7c3a9356..ca320b4f 100644 --- a/packages/neon/neon/lib/src/widgets/user_avatar.dart +++ b/packages/neon/neon/lib/src/widgets/user_avatar.dart @@ -9,7 +9,8 @@ import 'package:neon/src/theme/sizes.dart'; import 'package:neon/src/utils/provider.dart'; import 'package:neon/src/widgets/image.dart'; import 'package:neon/src/widgets/server_icon.dart'; -import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/core.dart' as core; +import 'package:nextcloud/user_status.dart' as user_status; import 'package:rxdart/rxdart.dart'; class NeonUserAvatar extends StatefulWidget { @@ -91,7 +92,7 @@ class _UserAvatarState extends State { }, ); - Widget _userStatusIconBuilder(final BuildContext context, final Result result) { + Widget _userStatusIconBuilder(final BuildContext context, final Result result) { final hasEmoji = result.data?.icon != null; final scaledSize = size / (hasEmoji ? 2 : 2.5); diff --git a/packages/neon/neon_files/lib/neon_files.dart b/packages/neon/neon_files/lib/neon_files.dart index 1e7985c9..ab20ddb4 100644 --- a/packages/neon/neon_files/lib/neon_files.dart +++ b/packages/neon/neon_files/lib/neon_files.dart @@ -13,7 +13,6 @@ import 'package:go_router/go_router.dart'; import 'package:image_picker/image_picker.dart'; import 'package:neon/blocs.dart'; import 'package:neon/models.dart'; -import 'package:neon/nextcloud.dart'; import 'package:neon/platform.dart'; import 'package:neon/settings.dart'; import 'package:neon/sort_box.dart'; @@ -23,6 +22,8 @@ import 'package:neon/widgets.dart'; import 'package:neon_files/l10n/localizations.dart'; import 'package:neon_files/routes.dart'; import 'package:neon_files/widgets/file_list_tile.dart'; +import 'package:nextcloud/core.dart' as core; +import 'package:nextcloud/nextcloud.dart'; import 'package:open_file/open_file.dart'; import 'package:path/path.dart' as p; import 'package:path_provider/path_provider.dart'; @@ -75,7 +76,7 @@ class FilesApp extends AppImplementation { @override (bool? supported, String? minimumVersion) isSupported( final Account account, - final CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities, + final core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities, ) => const (null, null); } diff --git a/packages/neon/neon_files/lib/routes.dart b/packages/neon/neon_files/lib/routes.dart index 134ec818..5bec7a54 100644 --- a/packages/neon/neon_files/lib/routes.dart +++ b/packages/neon/neon_files/lib/routes.dart @@ -1,8 +1,8 @@ import 'package:flutter/widgets.dart'; import 'package:go_router/go_router.dart'; -import 'package:neon/nextcloud.dart'; import 'package:neon/utils.dart'; import 'package:neon_files/neon_files.dart'; +import 'package:nextcloud/nextcloud.dart'; part 'routes.g.dart'; diff --git a/packages/neon/neon_files/pubspec.yaml b/packages/neon/neon_files/pubspec.yaml index 3f1c3ab8..62c77ee2 100644 --- a/packages/neon/neon_files/pubspec.yaml +++ b/packages/neon/neon_files/pubspec.yaml @@ -26,6 +26,10 @@ dependencies: git: url: https://github.com/nextcloud/neon path: packages/neon/neon + nextcloud: + git: + url: https://github.com/nextcloud/neon + path: packages/nextcloud open_file: ^3.0.0 path: ^1.0.0 path_provider: ^2.0.0 diff --git a/packages/neon/neon_news/lib/blocs/article.dart b/packages/neon/neon_news/lib/blocs/article.dart index 3fdf5d19..96b2cfc7 100644 --- a/packages/neon/neon_news/lib/blocs/article.dart +++ b/packages/neon/neon_news/lib/blocs/article.dart @@ -19,7 +19,7 @@ abstract interface class NewsArticleBlocStates { class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents, NewsArticleBlocStates { NewsArticleBloc( this._newsArticlesBloc, - final NewsArticle article, + final news.Article article, ) { _id = article.id; unread.add(article.unread); diff --git a/packages/neon/neon_news/lib/blocs/articles.dart b/packages/neon/neon_news/lib/blocs/articles.dart index 45b2c287..46a09711 100644 --- a/packages/neon/neon_news/lib/blocs/articles.dart +++ b/packages/neon/neon_news/lib/blocs/articles.dart @@ -14,17 +14,17 @@ enum ListType { abstract interface class NewsArticlesBlocEvents { void setFilterType(final FilterType type); - void markArticleAsRead(final NewsArticle article); + void markArticleAsRead(final news.Article article); - void markArticleAsUnread(final NewsArticle article); + void markArticleAsUnread(final news.Article article); - void starArticle(final NewsArticle article); + void starArticle(final news.Article article); - void unstarArticle(final NewsArticle article); + void unstarArticle(final news.Article article); } abstract interface class NewsArticlesBlocStates { - BehaviorSubject>> get articles; + BehaviorSubject>> get articles; BehaviorSubject get filterType; } @@ -69,7 +69,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents } @override - BehaviorSubject>> articles = BehaviorSubject>>(); + BehaviorSubject>> articles = BehaviorSubject>>(); @override BehaviorSubject filterType = BehaviorSubject(); @@ -87,7 +87,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents // https://github.com/nextcloud/news/blob/master/docs/api/api-v1-2.md#get-items // https://github.com/nextcloud/news/blob/48ee5ce4d135da20079961a62ae37958d6a6b628/lib/Db/ListType.php#L21 - late final NewsListType type; + late final news.ListType type; bool? getRead; if (listType != null) { switch (filterType.value) { @@ -101,21 +101,21 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents } switch (listType) { case ListType.feed: - type = NewsListType.feed; + type = news.ListType.feed; case ListType.folder: - type = NewsListType.folder; + type = news.ListType.folder; case null: switch (filterType.value) { case FilterType.starred: - type = NewsListType.starred; + type = news.ListType.starred; case FilterType.all: - type = NewsListType.allItems; + type = news.ListType.allItems; case FilterType.unread: - type = NewsListType.unread; + type = news.ListType.unread; } } - await RequestManager.instance.wrapNextcloud, NewsListArticles, void>( + await RequestManager.instance.wrapNextcloud, news.ListArticles, void>( account.id, 'news-articles-${type.index}-$id-$getRead', articles, @@ -129,12 +129,12 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents } @override - void markArticleAsRead(final NewsArticle article) { + void markArticleAsRead(final news.Article article) { wrapAction(() async => account.client.news.markArticleAsRead(itemId: article.id)); } @override - void markArticleAsUnread(final NewsArticle article) { + void markArticleAsUnread(final news.Article article) { wrapAction(() async => account.client.news.markArticleAsUnread(itemId: article.id)); } @@ -144,12 +144,12 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents } @override - void starArticle(final NewsArticle article) { + void starArticle(final news.Article article) { wrapAction(() async => account.client.news.starArticle(itemId: article.id)); } @override - void unstarArticle(final NewsArticle article) { + void unstarArticle(final news.Article article) { wrapAction(() async => account.client.news.unstarArticle(itemId: article.id)); } } diff --git a/packages/neon/neon_news/lib/blocs/news.dart b/packages/neon/neon_news/lib/blocs/news.dart index 1f7033de..8164977b 100644 --- a/packages/neon/neon_news/lib/blocs/news.dart +++ b/packages/neon/neon_news/lib/blocs/news.dart @@ -21,9 +21,9 @@ abstract interface class NewsBlocEvents { } abstract interface class NewsBlocStates { - BehaviorSubject>> get folders; + BehaviorSubject>> get folders; - BehaviorSubject>> get feeds; + BehaviorSubject>> get feeds; BehaviorSubject get unreadCounter; } @@ -75,16 +75,16 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates } @override - BehaviorSubject>> feeds = BehaviorSubject>>(); + BehaviorSubject>> feeds = BehaviorSubject>>(); @override - BehaviorSubject>> folders = BehaviorSubject>>(); + BehaviorSubject>> folders = BehaviorSubject>>(); @override BehaviorSubject unreadCounter = BehaviorSubject(); @override - late BehaviorSubject>> articles = mainArticlesBloc.articles; + late BehaviorSubject>> articles = mainArticlesBloc.articles; @override late BehaviorSubject filterType = mainArticlesBloc.filterType; @@ -92,14 +92,14 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates @override Future refresh() async { await Future.wait([ - RequestManager.instance.wrapNextcloud, NewsListFolders, void>( + RequestManager.instance.wrapNextcloud, news.ListFolders, void>( account.id, 'news-folders', folders, account.client.news.listFoldersRaw(), (final response) => response.body.folders.toList(), ), - RequestManager.instance.wrapNextcloud, NewsListFeeds, void>( + RequestManager.instance.wrapNextcloud, news.ListFeeds, void>( account.id, 'news-feeds', feeds, @@ -161,12 +161,12 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates } @override - void markArticleAsRead(final NewsArticle article) { + void markArticleAsRead(final news.Article article) { mainArticlesBloc.markArticleAsRead(article); } @override - void markArticleAsUnread(final NewsArticle article) { + void markArticleAsUnread(final news.Article article) { mainArticlesBloc.markArticleAsUnread(article); } @@ -176,12 +176,12 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates } @override - void starArticle(final NewsArticle article) { + void starArticle(final news.Article article) { mainArticlesBloc.starArticle(article); } @override - void unstarArticle(final NewsArticle article) { + void unstarArticle(final news.Article article) { mainArticlesBloc.unstarArticle(article); } diff --git a/packages/neon/neon_news/lib/dialogs/add_feed.dart b/packages/neon/neon_news/lib/dialogs/add_feed.dart index d212fe38..62ee238e 100644 --- a/packages/neon/neon_news/lib/dialogs/add_feed.dart +++ b/packages/neon/neon_news/lib/dialogs/add_feed.dart @@ -18,7 +18,7 @@ class _NewsAddFeedDialogState extends State { final formKey = GlobalKey(); final controller = TextEditingController(); - NewsFolder? folder; + news.Folder? folder; void submit() { if (formKey.currentState!.validate()) { @@ -49,7 +49,7 @@ class _NewsAddFeedDialogState extends State { } @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( stream: widget.bloc.folders, builder: (final context, final folders) => NeonDialog( title: Text(AppLocalizations.of(context).feedAdd), diff --git a/packages/neon/neon_news/lib/dialogs/feed_show_url.dart b/packages/neon/neon_news/lib/dialogs/feed_show_url.dart index 225e4b3e..68e42d07 100644 --- a/packages/neon/neon_news/lib/dialogs/feed_show_url.dart +++ b/packages/neon/neon_news/lib/dialogs/feed_show_url.dart @@ -6,7 +6,7 @@ class NewsFeedShowURLDialog extends StatefulWidget { super.key, }); - final NewsFeed feed; + final news.Feed feed; @override State createState() => _NewsFeedShowURLDialogState(); diff --git a/packages/neon/neon_news/lib/dialogs/feed_update_error.dart b/packages/neon/neon_news/lib/dialogs/feed_update_error.dart index 8c851915..06acab17 100644 --- a/packages/neon/neon_news/lib/dialogs/feed_update_error.dart +++ b/packages/neon/neon_news/lib/dialogs/feed_update_error.dart @@ -6,7 +6,7 @@ class NewsFeedUpdateErrorDialog extends StatefulWidget { super.key, }); - final NewsFeed feed; + final news.Feed feed; @override State createState() => _NewsFeedUpdateErrorDialogState(); diff --git a/packages/neon/neon_news/lib/dialogs/move_feed.dart b/packages/neon/neon_news/lib/dialogs/move_feed.dart index f9d1f6a5..b4d759de 100644 --- a/packages/neon/neon_news/lib/dialogs/move_feed.dart +++ b/packages/neon/neon_news/lib/dialogs/move_feed.dart @@ -7,8 +7,8 @@ class NewsMoveFeedDialog extends StatefulWidget { super.key, }); - final List folders; - final NewsFeed feed; + final List folders; + final news.Feed feed; @override State createState() => _NewsMoveFeedDialogState(); @@ -17,7 +17,7 @@ class NewsMoveFeedDialog extends StatefulWidget { class _NewsMoveFeedDialogState extends State { final formKey = GlobalKey(); - NewsFolder? folder; + news.Folder? folder; void submit() { if (formKey.currentState!.validate()) { diff --git a/packages/neon/neon_news/lib/neon_news.dart b/packages/neon/neon_news/lib/neon_news.dart index 778b637a..751fbddf 100644 --- a/packages/neon/neon_news/lib/neon_news.dart +++ b/packages/neon/neon_news/lib/neon_news.dart @@ -12,7 +12,6 @@ import 'package:html/dom.dart' as html_dom; import 'package:html/parser.dart' as html_parser; import 'package:neon/blocs.dart'; import 'package:neon/models.dart'; -import 'package:neon/nextcloud.dart'; import 'package:neon/platform.dart'; import 'package:neon/settings.dart'; import 'package:neon/sort_box.dart'; @@ -21,6 +20,9 @@ import 'package:neon/utils.dart'; import 'package:neon/widgets.dart'; import 'package:neon_news/l10n/localizations.dart'; import 'package:neon_news/routes.dart'; +import 'package:nextcloud/core.dart' as core; +import 'package:nextcloud/news.dart' as news; +import 'package:nextcloud/nextcloud.dart'; import 'package:rxdart/rxdart.dart'; import 'package:share_plus/share_plus.dart'; import 'package:url_launcher/url_launcher_string.dart'; @@ -85,7 +87,7 @@ class NewsApp extends AppImplementation { @override Future<(bool? supported, String? minimumVersion)> isSupported( final Account account, - final CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities, + final core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities, ) => account.client.news.isSupported(); } diff --git a/packages/neon/neon_news/lib/pages/feed.dart b/packages/neon/neon_news/lib/pages/feed.dart index 108c5ba0..e216bac3 100644 --- a/packages/neon/neon_news/lib/pages/feed.dart +++ b/packages/neon/neon_news/lib/pages/feed.dart @@ -8,7 +8,7 @@ class NewsFeedPage extends StatelessWidget { }); final NewsBloc bloc; - final NewsFeed feed; + final news.Feed feed; @override Widget build(final BuildContext context) => Scaffold( diff --git a/packages/neon/neon_news/lib/pages/folder.dart b/packages/neon/neon_news/lib/pages/folder.dart index 4fbdce45..d08b84c3 100644 --- a/packages/neon/neon_news/lib/pages/folder.dart +++ b/packages/neon/neon_news/lib/pages/folder.dart @@ -8,7 +8,7 @@ class NewsFolderPage extends StatelessWidget { }); final NewsBloc bloc; - final NewsFolder folder; + final news.Folder folder; @override Widget build(final BuildContext context) => Scaffold( diff --git a/packages/neon/neon_news/lib/routes.dart b/packages/neon/neon_news/lib/routes.dart index 14959c50..1d1e5528 100644 --- a/packages/neon/neon_news/lib/routes.dart +++ b/packages/neon/neon_news/lib/routes.dart @@ -1,8 +1,8 @@ import 'package:flutter/widgets.dart'; import 'package:go_router/go_router.dart'; -import 'package:neon/nextcloud.dart'; import 'package:neon/utils.dart'; import 'package:neon_news/neon_news.dart'; +import 'package:nextcloud/nextcloud.dart'; part 'routes.g.dart'; diff --git a/packages/neon/neon_news/lib/sort/articles.dart b/packages/neon/neon_news/lib/sort/articles.dart index 4a082afb..1909d98d 100644 --- a/packages/neon/neon_news/lib/sort/articles.dart +++ b/packages/neon/neon_news/lib/sort/articles.dart @@ -1,6 +1,6 @@ part of '../neon_news.dart'; -final articlesSortBox = SortBox( +final articlesSortBox = SortBox( { ArticlesSortProperty.publishDate: (final article) => article.pubDate, ArticlesSortProperty.alphabetical: (final article) => article.title.toLowerCase(), diff --git a/packages/neon/neon_news/lib/sort/feeds.dart b/packages/neon/neon_news/lib/sort/feeds.dart index c25d3596..a873f87c 100644 --- a/packages/neon/neon_news/lib/sort/feeds.dart +++ b/packages/neon/neon_news/lib/sort/feeds.dart @@ -1,6 +1,6 @@ part of '../neon_news.dart'; -final feedsSortBox = SortBox( +final feedsSortBox = SortBox( { FeedsSortProperty.alphabetical: (final feed) => feed.title.toLowerCase(), FeedsSortProperty.unreadCount: (final feed) => feed.unreadCount ?? 0, diff --git a/packages/neon/neon_news/lib/sort/folders.dart b/packages/neon/neon_news/lib/sort/folders.dart index cfc1bc9d..9cc93215 100644 --- a/packages/neon/neon_news/lib/sort/folders.dart +++ b/packages/neon/neon_news/lib/sort/folders.dart @@ -15,4 +15,4 @@ final foldersSortBox = SortBox( }, ); -typedef FolderFeedsWrapper = (NewsFolder folder, int feedCount, int unreadCount); +typedef FolderFeedsWrapper = (news.Folder folder, int feedCount, int unreadCount); diff --git a/packages/neon/neon_news/lib/widgets/articles_view.dart b/packages/neon/neon_news/lib/widgets/articles_view.dart index 88cb8563..4a2ca54a 100644 --- a/packages/neon/neon_news/lib/widgets/articles_view.dart +++ b/packages/neon/neon_news/lib/widgets/articles_view.dart @@ -25,11 +25,11 @@ class _NewsArticlesViewState extends State { } @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( stream: widget.newsBloc.feeds, - builder: (final context, final feeds) => ResultBuilder>.behaviorSubject( + builder: (final context, final feeds) => ResultBuilder>.behaviorSubject( stream: widget.bloc.articles, - builder: (final context, final articles) => SortBoxBuilder( + builder: (final context, final articles) => SortBoxBuilder( sortBox: articlesSortBox, sortProperty: widget.newsBloc.options.articlesSortPropertyOption, sortBoxOrder: widget.newsBloc.options.articlesSortBoxOrderOption, @@ -101,8 +101,8 @@ class _NewsArticlesViewState extends State { Widget _buildArticle( final BuildContext context, - final NewsArticle article, - final NewsFeed feed, + final news.Article article, + final news.Feed feed, ) => ListTile( title: Row( diff --git a/packages/neon/neon_news/lib/widgets/feed_icon.dart b/packages/neon/neon_news/lib/widgets/feed_icon.dart index dcf25353..7c6d120f 100644 --- a/packages/neon/neon_news/lib/widgets/feed_icon.dart +++ b/packages/neon/neon_news/lib/widgets/feed_icon.dart @@ -8,7 +8,7 @@ class NewsFeedIcon extends StatelessWidget { super.key, }); - final NewsFeed feed; + final news.Feed feed; final double size; final BorderRadius? borderRadius; diff --git a/packages/neon/neon_news/lib/widgets/feeds_view.dart b/packages/neon/neon_news/lib/widgets/feeds_view.dart index 14b88b93..d20b9e70 100644 --- a/packages/neon/neon_news/lib/widgets/feeds_view.dart +++ b/packages/neon/neon_news/lib/widgets/feeds_view.dart @@ -11,11 +11,11 @@ class NewsFeedsView extends StatelessWidget { final int? folderID; @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( stream: bloc.folders, - builder: (final context, final folders) => ResultBuilder>.behaviorSubject( + builder: (final context, final folders) => ResultBuilder>.behaviorSubject( stream: bloc.feeds, - builder: (final context, final feeds) => SortBoxBuilder( + builder: (final context, final feeds) => SortBoxBuilder( sortBox: feedsSortBox, sortProperty: bloc.options.feedsSortPropertyOption, sortBoxOrder: bloc.options.feedsSortBoxOrderOption, @@ -40,8 +40,8 @@ class NewsFeedsView extends StatelessWidget { Widget _buildFeed( final BuildContext context, - final NewsFeed feed, - final List folders, + final news.Feed feed, + final List folders, ) => ListTile( title: Text( diff --git a/packages/neon/neon_news/lib/widgets/folder_select.dart b/packages/neon/neon_news/lib/widgets/folder_select.dart index 569d3dd7..7d3c19a5 100644 --- a/packages/neon/neon_news/lib/widgets/folder_select.dart +++ b/packages/neon/neon_news/lib/widgets/folder_select.dart @@ -8,12 +8,12 @@ class NewsFolderSelect extends StatelessWidget { super.key, }); - final List folders; - final ValueChanged onChanged; - final NewsFolder? value; + final List folders; + final ValueChanged onChanged; + final news.Folder? value; @override - Widget build(final BuildContext context) => DropdownButtonFormField( + Widget build(final BuildContext context) => DropdownButtonFormField( decoration: InputDecoration( hintText: AppLocalizations.of(context).folder, ), @@ -23,7 +23,7 @@ class NewsFolderSelect extends StatelessWidget { child: Text(AppLocalizations.of(context).folderRoot), ), ...folders.map( - (final f) => DropdownMenuItem( + (final f) => DropdownMenuItem( value: f, child: Text(f.name), ), diff --git a/packages/neon/neon_news/lib/widgets/folder_view.dart b/packages/neon/neon_news/lib/widgets/folder_view.dart index aa6f438b..a04f31dd 100644 --- a/packages/neon/neon_news/lib/widgets/folder_view.dart +++ b/packages/neon/neon_news/lib/widgets/folder_view.dart @@ -8,7 +8,7 @@ class NewsFolderView extends StatefulWidget { }); final NewsBloc bloc; - final NewsFolder folder; + final news.Folder folder; @override State createState() => _NewsFolderViewState(); diff --git a/packages/neon/neon_news/lib/widgets/folders_view.dart b/packages/neon/neon_news/lib/widgets/folders_view.dart index 2e7e45a0..be01c9e6 100644 --- a/packages/neon/neon_news/lib/widgets/folders_view.dart +++ b/packages/neon/neon_news/lib/widgets/folders_view.dart @@ -9,9 +9,9 @@ class NewsFoldersView extends StatelessWidget { final NewsBloc bloc; @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( stream: bloc.folders, - builder: (final context, final folders) => ResultBuilder>.behaviorSubject( + builder: (final context, final folders) => ResultBuilder>.behaviorSubject( stream: bloc.feeds, builder: (final context, final feeds) => SortBoxBuilder( sortBox: foldersSortBox, diff --git a/packages/neon/neon_news/pubspec.yaml b/packages/neon/neon_news/pubspec.yaml index a8c7e151..1d2f6815 100644 --- a/packages/neon/neon_news/pubspec.yaml +++ b/packages/neon/neon_news/pubspec.yaml @@ -20,6 +20,10 @@ dependencies: git: url: https://github.com/nextcloud/neon path: packages/neon/neon + nextcloud: + git: + url: https://github.com/nextcloud/neon + path: packages/nextcloud rxdart: ^0.27.0 share_plus: ^7.0.0 url_launcher: ^6.0.0 diff --git a/packages/neon/neon_notes/lib/blocs/note.dart b/packages/neon/neon_notes/lib/blocs/note.dart index d090e4c7..bd85bded 100644 --- a/packages/neon/neon_notes/lib/blocs/note.dart +++ b/packages/neon/neon_notes/lib/blocs/note.dart @@ -15,7 +15,7 @@ abstract interface class NotesNoteBlocStates { class NotesNoteBloc extends InteractiveBloc implements NotesNoteBlocEvents, NotesNoteBlocStates { NotesNoteBloc( this._notesBloc, - final NotesNote note, + final notes.Note note, ) { _emitNote(note); id = note.id; @@ -23,13 +23,13 @@ class NotesNoteBloc extends InteractiveBloc implements NotesNoteBlocEvents, Note initialTitle = note.title; } - void _emitNote(final NotesNote note) { + void _emitNote(final notes.Note note) { category.add(note.category); _etag = note.etag; } // ignore: avoid_void_async - void _wrapAction(final Future> Function(String etag) call) async { + void _wrapAction(final Future> Function(String etag) call) async { await _updateQueue.add(() async { try { final response = await call(_etag); diff --git a/packages/neon/neon_notes/lib/blocs/notes.dart b/packages/neon/neon_notes/lib/blocs/notes.dart index 64e3a38f..929fd9f9 100644 --- a/packages/neon/neon_notes/lib/blocs/notes.dart +++ b/packages/neon/neon_notes/lib/blocs/notes.dart @@ -19,7 +19,7 @@ abstract interface class NotesBlocEvents { } abstract interface class NotesBlocStates { - BehaviorSubject>> get notes; + BehaviorSubject>> get notesList; } class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocStates { @@ -35,21 +35,21 @@ class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocSta @override void dispose() { - unawaited(notes.close()); + unawaited(notesList.close()); super.dispose(); } @override - BehaviorSubject>> notes = BehaviorSubject>>(); + BehaviorSubject>> notesList = BehaviorSubject>>(); @override Future refresh() async { - await RequestManager.instance.wrapNextcloud, BuiltList, void>( + await RequestManager.instance.wrapNextcloud, BuiltList, void>( account.id, 'notes-notes', - notes, + notesList, account.client.notes.getNotesRaw(), - (final response) => List.from(response.body), + (final response) => List.from(response.body), ); } diff --git a/packages/neon/neon_notes/lib/dialogs/create_note.dart b/packages/neon/neon_notes/lib/dialogs/create_note.dart index fc99c4c6..5888b613 100644 --- a/packages/neon/neon_notes/lib/dialogs/create_note.dart +++ b/packages/neon/neon_notes/lib/dialogs/create_note.dart @@ -32,8 +32,8 @@ class _NotesCreateNoteDialogState extends State { } @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( - stream: widget.bloc.notes, + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + stream: widget.bloc.notesList, builder: (final context, final notes) => NeonDialog( title: Text(AppLocalizations.of(context).noteCreate), children: [ diff --git a/packages/neon/neon_notes/lib/dialogs/select_category.dart b/packages/neon/neon_notes/lib/dialogs/select_category.dart index e8d8c956..8baab085 100644 --- a/packages/neon/neon_notes/lib/dialogs/select_category.dart +++ b/packages/neon/neon_notes/lib/dialogs/select_category.dart @@ -26,8 +26,8 @@ class _NotesSelectCategoryDialogState extends State { } @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( - stream: widget.bloc.notes, + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + stream: widget.bloc.notesList, builder: (final context, final notes) => NeonDialog( title: Text(AppLocalizations.of(context).category), children: [ diff --git a/packages/neon/neon_notes/lib/neon_notes.dart b/packages/neon/neon_notes/lib/neon_notes.dart index bb1ff6ff..a94f573d 100644 --- a/packages/neon/neon_notes/lib/neon_notes.dart +++ b/packages/neon/neon_notes/lib/neon_notes.dart @@ -11,7 +11,6 @@ import 'package:flutter_material_design_icons/flutter_material_design_icons.dart import 'package:go_router/go_router.dart'; import 'package:neon/blocs.dart'; import 'package:neon/models.dart'; -import 'package:neon/nextcloud.dart'; import 'package:neon/settings.dart'; import 'package:neon/sort_box.dart'; import 'package:neon/theme.dart'; @@ -19,6 +18,9 @@ import 'package:neon/utils.dart'; import 'package:neon/widgets.dart'; import 'package:neon_notes/l10n/localizations.dart'; import 'package:neon_notes/routes.dart'; +import 'package:nextcloud/core.dart' as core; +import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/notes.dart' as notes; import 'package:queue/queue.dart'; import 'package:rxdart/rxdart.dart'; import 'package:url_launcher/url_launcher_string.dart'; @@ -71,7 +73,7 @@ class NotesApp extends AppImplementation { @override (bool? supported, String? minimumVersion) isSupported( final Account account, - final CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities, + final core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities, ) { final (supported, minimumVersion) = account.client.notes.isSupported(capabilities); return (supported, minimumVersion.toString()); diff --git a/packages/neon/neon_notes/lib/routes.dart b/packages/neon/neon_notes/lib/routes.dart index 58444f0f..e8a187ae 100644 --- a/packages/neon/neon_notes/lib/routes.dart +++ b/packages/neon/neon_notes/lib/routes.dart @@ -1,8 +1,8 @@ import 'package:flutter/widgets.dart'; import 'package:go_router/go_router.dart'; -import 'package:neon/nextcloud.dart'; import 'package:neon/utils.dart'; import 'package:neon_notes/neon_notes.dart'; +import 'package:nextcloud/nextcloud.dart'; part 'routes.g.dart'; diff --git a/packages/neon/neon_notes/lib/sort/notes.dart b/packages/neon/neon_notes/lib/sort/notes.dart index bed700b2..b40e3c49 100644 --- a/packages/neon/neon_notes/lib/sort/notes.dart +++ b/packages/neon/neon_notes/lib/sort/notes.dart @@ -1,6 +1,6 @@ part of '../neon_notes.dart'; -final notesSortBox = SortBox( +final notesSortBox = SortBox( { NotesSortProperty.alphabetical: (final note) => note.title.toLowerCase(), NotesSortProperty.lastModified: (final note) => note.modified, diff --git a/packages/neon/neon_notes/lib/widgets/categories_view.dart b/packages/neon/neon_notes/lib/widgets/categories_view.dart index dd04001f..01f2171e 100644 --- a/packages/neon/neon_notes/lib/widgets/categories_view.dart +++ b/packages/neon/neon_notes/lib/widgets/categories_view.dart @@ -9,8 +9,8 @@ class NotesCategoriesView extends StatelessWidget { final NotesBloc bloc; @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( - stream: bloc.notes, + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + stream: bloc.notesList, builder: (final context, final notes) => SortBoxBuilder( sortBox: categoriesSortBox, sortProperty: bloc.options.categoriesSortPropertyOption, diff --git a/packages/neon/neon_notes/lib/widgets/notes_view.dart b/packages/neon/neon_notes/lib/widgets/notes_view.dart index e1fb7ac7..e2c6e547 100644 --- a/packages/neon/neon_notes/lib/widgets/notes_view.dart +++ b/packages/neon/neon_notes/lib/widgets/notes_view.dart @@ -11,20 +11,22 @@ class NotesView extends StatelessWidget { final String? category; @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( - stream: bloc.notes, - builder: (final context, final notes) => SortBoxBuilder( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + stream: bloc.notesList, + builder: (final context, final notesList) => SortBoxBuilder( sortBox: notesSortBox, presort: const { (NotesSortProperty.favorite, SortBoxOrder.ascending), }, sortProperty: bloc.options.notesSortPropertyOption, sortBoxOrder: bloc.options.notesSortBoxOrderOption, - input: category != null ? notes.data?.where((final note) => note.category == category).toList() : notes.data, + input: category != null + ? notesList.data?.where((final note) => note.category == category).toList() + : notesList.data, builder: (final context, final sorted) => NeonListView( scrollKey: 'notes-notes', - isLoading: notes.isLoading, - error: notes.error, + isLoading: notesList.isLoading, + error: notesList.error, onRefresh: bloc.refresh, itemCount: sorted.length, itemBuilder: (final context, final index) => _buildNote(context, sorted[index]), @@ -34,7 +36,7 @@ class NotesView extends StatelessWidget { Widget _buildNote( final BuildContext context, - final NotesNote note, + final notes.Note note, ) => ListTile( title: Text(note.title), diff --git a/packages/neon/neon_notes/pubspec.yaml b/packages/neon/neon_notes/pubspec.yaml index 0c8dd1b7..3b37109c 100644 --- a/packages/neon/neon_notes/pubspec.yaml +++ b/packages/neon/neon_notes/pubspec.yaml @@ -21,6 +21,10 @@ dependencies: git: url: https://github.com/nextcloud/neon path: packages/neon/neon + nextcloud: + git: + url: https://github.com/nextcloud/neon + path: packages/nextcloud queue: ^3.0.0 rxdart: ^0.27.0 url_launcher: ^6.0.0 diff --git a/packages/neon/neon_notifications/lib/blocs/notifications.dart b/packages/neon/neon_notifications/lib/blocs/notifications.dart index 6ea611e0..45cd5b96 100644 --- a/packages/neon/neon_notifications/lib/blocs/notifications.dart +++ b/packages/neon/neon_notifications/lib/blocs/notifications.dart @@ -7,7 +7,7 @@ abstract interface class NotificationsBlocEvents { } abstract interface class NotificationsBlocStates { - BehaviorSubject>> get notifications; + BehaviorSubject>> get notificationsList; BehaviorSubject get unreadCounter; } @@ -18,7 +18,7 @@ class NotificationsBloc extends InteractiveBloc this.options, this._account, ) { - notifications.listen((final result) { + notificationsList.listen((final result) { if (result.hasData) { unreadCounter.add(result.requireData.length); } @@ -36,25 +36,25 @@ class NotificationsBloc extends InteractiveBloc @override void dispose() { _timer.cancel(); - unawaited(notifications.close()); + unawaited(notificationsList.close()); unawaited(unreadCounter.close()); super.dispose(); } @override - BehaviorSubject>> notifications = - BehaviorSubject>>(); + BehaviorSubject>> notificationsList = + BehaviorSubject>>(); @override BehaviorSubject unreadCounter = BehaviorSubject(); @override Future refresh() async { - await RequestManager.instance.wrapNextcloud, - NotificationsEndpointListNotificationsResponseApplicationJson, void>( + await RequestManager.instance.wrapNextcloud, + notifications.EndpointListNotificationsResponseApplicationJson, void>( _account.id, 'notifications-notifications', - notifications, + notificationsList, _account.client.notifications.endpoint.listNotificationsRaw(), (final response) => response.body.ocs.data.toList(), ); diff --git a/packages/neon/neon_notifications/lib/neon_notifications.dart b/packages/neon/neon_notifications/lib/neon_notifications.dart index b02ea9f5..d0e4156a 100644 --- a/packages/neon/neon_notifications/lib/neon_notifications.dart +++ b/packages/neon/neon_notifications/lib/neon_notifications.dart @@ -7,13 +7,15 @@ import 'package:flutter_material_design_icons/flutter_material_design_icons.dart import 'package:go_router/go_router.dart'; import 'package:neon/blocs.dart'; import 'package:neon/models.dart'; -import 'package:neon/nextcloud.dart'; import 'package:neon/settings.dart'; import 'package:neon/theme.dart'; import 'package:neon/utils.dart'; import 'package:neon/widgets.dart'; import 'package:neon_notifications/l10n/localizations.dart'; import 'package:neon_notifications/routes.dart'; +import 'package:nextcloud/core.dart' as core; +import 'package:nextcloud/nextcloud.dart'; +import 'package:nextcloud/notifications.dart' as notifications; import 'package:rxdart/rxdart.dart'; part 'blocs/notifications.dart'; @@ -56,7 +58,7 @@ class NotificationsApp extends AppImplementation const (null, null); } diff --git a/packages/neon/neon_notifications/lib/pages/main.dart b/packages/neon/neon_notifications/lib/pages/main.dart index 41695d71..24c97777 100644 --- a/packages/neon/neon_notifications/lib/pages/main.dart +++ b/packages/neon/neon_notifications/lib/pages/main.dart @@ -24,8 +24,8 @@ class _NotificationsMainPageState extends State { } @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( - stream: bloc.notifications, + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + stream: bloc.notificationsList, builder: (final context, final notifications) => Scaffold( resizeToAvoidBottomInset: false, floatingActionButton: StreamBuilder( @@ -52,7 +52,7 @@ class _NotificationsMainPageState extends State { Widget _buildNotification( final BuildContext context, - final NotificationsNotification notification, + final notifications.Notification notification, ) { final app = NeonProvider.of>(context).tryFind(notification.app); diff --git a/packages/neon/neon_notifications/lib/routes.dart b/packages/neon/neon_notifications/lib/routes.dart index 3a5a466c..4e80ccce 100644 --- a/packages/neon/neon_notifications/lib/routes.dart +++ b/packages/neon/neon_notifications/lib/routes.dart @@ -1,8 +1,8 @@ import 'package:flutter/widgets.dart'; import 'package:go_router/go_router.dart'; -import 'package:neon/nextcloud.dart'; import 'package:neon/utils.dart'; import 'package:neon_notifications/neon_notifications.dart'; +import 'package:nextcloud/nextcloud.dart'; part 'routes.g.dart'; diff --git a/packages/neon/neon_notifications/pubspec.yaml b/packages/neon/neon_notifications/pubspec.yaml index 9a61810c..7be91e81 100644 --- a/packages/neon/neon_notifications/pubspec.yaml +++ b/packages/neon/neon_notifications/pubspec.yaml @@ -18,6 +18,10 @@ dependencies: git: url: https://github.com/nextcloud/neon path: packages/neon/neon + nextcloud: + git: + url: https://github.com/nextcloud/neon + path: packages/nextcloud rxdart: ^0.27.0 dev_dependencies: