diff --git a/packages/neon/neon/lib/src/blocs/apps.dart b/packages/neon/neon/lib/src/blocs/apps.dart index 730a9945..5267d3fb 100644 --- a/packages/neon/neon/lib/src/blocs/apps.dart +++ b/packages/neon/neon/lib/src/blocs/apps.dart @@ -1,6 +1,6 @@ part of 'blocs.dart'; -typedef NextcloudApp = NextcloudCoreNavigationApps_Ocs_Data; +typedef NextcloudApp = CoreNavigationApps_Ocs_Data; abstract class AppsBlocEvents { void setActiveApp(final String appID); @@ -165,7 +165,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates @override Future refresh() async { - await _requestManager.wrapNextcloud, NextcloudCoreNavigationApps>( + await _requestManager.wrapNextcloud, CoreNavigationApps>( _account.client.id, 'apps-apps', apps, diff --git a/packages/neon/neon/lib/src/blocs/capabilities.dart b/packages/neon/neon/lib/src/blocs/capabilities.dart index bc50560d..e8df66c2 100644 --- a/packages/neon/neon/lib/src/blocs/capabilities.dart +++ b/packages/neon/neon/lib/src/blocs/capabilities.dart @@ -1,7 +1,7 @@ part of 'blocs.dart'; -typedef Capabilities = NextcloudCoreServerCapabilities_Ocs_Data; -typedef NextcloudTheme = NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_Theming; +typedef Capabilities = CoreServerCapabilities_Ocs_Data; +typedef NextcloudTheme = CoreServerCapabilities_Ocs_Data_Capabilities_Theming; abstract class CapabilitiesBlocEvents {} @@ -31,7 +31,7 @@ class CapabilitiesBloc extends InteractiveBloc implements CapabilitiesBlocEvents @override Future refresh() async { - await _requestManager.wrapNextcloud( + await _requestManager.wrapNextcloud( _client.id, 'capabilities', capabilities, diff --git a/packages/neon/neon/lib/src/blocs/login.dart b/packages/neon/neon/lib/src/blocs/login.dart index cf64e39d..14d3695a 100644 --- a/packages/neon/neon/lib/src/blocs/login.dart +++ b/packages/neon/neon/lib/src/blocs/login.dart @@ -9,9 +9,9 @@ abstract class LoginBlocStates { BehaviorSubject get serverConnectionState; - BehaviorSubject get loginFlowInit; + BehaviorSubject get loginFlowInit; - BehaviorSubject get loginFlowResult; + BehaviorSubject get loginFlowResult; } class LoginBloc extends InteractiveBloc implements LoginBlocEvents, LoginBlocStates { @@ -31,12 +31,10 @@ class LoginBloc extends InteractiveBloc implements LoginBlocEvents, LoginBlocSta } @override - BehaviorSubject loginFlowInit = - BehaviorSubject.seeded(null); + BehaviorSubject loginFlowInit = BehaviorSubject.seeded(null); @override - BehaviorSubject loginFlowResult = - BehaviorSubject.seeded(null); + BehaviorSubject loginFlowResult = BehaviorSubject.seeded(null); @override BehaviorSubject serverConnectionState = BehaviorSubject.seeded(null); diff --git a/packages/neon/neon/lib/src/blocs/next_push.dart b/packages/neon/neon/lib/src/blocs/next_push.dart index 59c06137..3e645d03 100644 --- a/packages/neon/neon/lib/src/blocs/next_push.dart +++ b/packages/neon/neon/lib/src/blocs/next_push.dart @@ -39,7 +39,7 @@ class NextPushBloc extends Bloc implements NextPushBlocEvents, NextPushBlocState for (final account in _accountsBloc.accounts.value) { if (!_supported.containsKey(account)) { try { - _supported[account] = (await account.client.unifiedPushProvider.check()).success; + _supported[account] = (await account.client.uppush.check()).success; } catch (e, s) { debugPrint(e.toString()); debugPrint(s.toString()); diff --git a/packages/neon/neon/lib/src/blocs/user_details.dart b/packages/neon/neon/lib/src/blocs/user_details.dart index 71e651d7..4f8ab596 100644 --- a/packages/neon/neon/lib/src/blocs/user_details.dart +++ b/packages/neon/neon/lib/src/blocs/user_details.dart @@ -3,7 +3,7 @@ part of 'blocs.dart'; abstract class UserDetailsBlocEvents {} abstract class UserDetailsBlocStates { - BehaviorSubject> get userDetails; + BehaviorSubject> get userDetails; } class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents, UserDetailsBlocStates { @@ -24,12 +24,12 @@ class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents, } @override - BehaviorSubject> userDetails = - BehaviorSubject>(); + BehaviorSubject> userDetails = + BehaviorSubject>(); @override Future refresh() async { - await _requestManager.wrapNextcloud( + await _requestManager.wrapNextcloud( _client.id, 'user-details', userDetails, diff --git a/packages/neon/neon/lib/src/blocs/user_statuses.dart b/packages/neon/neon/lib/src/blocs/user_statuses.dart index 83eb2950..f81daa0a 100644 --- a/packages/neon/neon/lib/src/blocs/user_statuses.dart +++ b/packages/neon/neon/lib/src/blocs/user_statuses.dart @@ -5,7 +5,7 @@ abstract class UserStatusesBlocEvents { } abstract class UserStatusesBlocStates { - BehaviorSubject>> get statuses; + BehaviorSubject>> get statuses; } class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents, UserStatusesBlocStates { @@ -29,8 +29,8 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents } @override - BehaviorSubject>> statuses = - BehaviorSubject>>(); + BehaviorSubject>> statuses = + BehaviorSubject>>(); @override Future refresh() async { @@ -48,17 +48,17 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents try { _updateStatus(username, Result.loading()); - NextcloudUserStatusPublicStatus? data; + UserStatusPublicStatus? data; if (_account.username == username) { final isAway = _platform.canUseWindowManager && (!(await windowManager.isFocused()) || !(await windowManager.isVisible())); final response = await _account.client.userStatus.heartbeat( - status: isAway ? NextcloudUserStatusType.away : NextcloudUserStatusType.online, + status: isAway ? UserStatusType.away : UserStatusType.online, ); - data = response.ocs.data.userStatusStatus?.userStatusPublicStatus; + data = response.ocs.data.status?.publicStatus; } else { final response = await _account.client.userStatus.getPublicStatus(userId: username); - data = response.ocs.data.userStatusPublicStatus; + data = response.ocs.data.publicStatus; } _updateStatus(username, Result.success(data)); @@ -73,10 +73,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/push_notification.dart b/packages/neon/neon/lib/src/models/push_notification.dart index c8d6aa5f..2fe353a8 100644 --- a/packages/neon/neon/lib/src/models/push_notification.dart +++ b/packages/neon/neon/lib/src/models/push_notification.dart @@ -23,5 +23,5 @@ class PushNotification { final String type; - final NextcloudNotificationsNotificationDecryptedSubject subject; + final NotificationsNotificationDecryptedSubject 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 dc2208f6..5705d8d6 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: NextcloudNotificationsNotificationDecryptedSubject.fromJson(json['subject'] as Map), + subject: NotificationsNotificationDecryptedSubject.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 5084e3c6..8e9d349e 100644 --- a/packages/neon/neon/lib/src/pages/account_settings.dart +++ b/packages/neon/neon/lib/src/pages/account_settings.dart @@ -59,7 +59,7 @@ class AccountSettingsPage extends StatelessWidget { ), ], ), - body: ResultBuilder.behaviorSubject( + body: ResultBuilder.behaviorSubject( stream: _userDetailsBloc.userDetails, builder: (final context, final userDetails) => SettingsList( categories: [ diff --git a/packages/neon/neon/lib/src/utils/push_utils.dart b/packages/neon/neon/lib/src/utils/push_utils.dart index f9a62573..56db29e2 100644 --- a/packages/neon/neon/lib/src/utils/push_utils.dart +++ b/packages/neon/neon/lib/src/utils/push_utils.dart @@ -78,7 +78,7 @@ class PushUtils { var accounts = []; Account? account; - NextcloudNotificationsNotification? notification; + NotificationsNotification? notification; AndroidBitmap? largeIconBitmap; try { accounts = loadAccounts(AppStorage('accounts', sharedPreferences)); diff --git a/packages/neon/neon/lib/src/utils/theme.dart b/packages/neon/neon/lib/src/utils/theme.dart index 4441ad05..f82eaad8 100644 --- a/packages/neon/neon/lib/src/utils/theme.dart +++ b/packages/neon/neon/lib/src/utils/theme.dart @@ -3,7 +3,7 @@ part of '../../neon.dart'; const themePrimaryColor = Color(0xFFF37736); ThemeData getThemeFromNextcloudTheme( - final NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_Theming? nextcloudTheme, + final CoreServerCapabilities_Ocs_Data_Capabilities_Theming? nextcloudTheme, final Brightness brightness, { required final bool keepOriginalAccentColor, final bool oledAsDark = false, diff --git a/packages/neon/neon/lib/src/widgets/account_tile.dart b/packages/neon/neon/lib/src/widgets/account_tile.dart index e03d3846..8809e431 100644 --- a/packages/neon/neon/lib/src/widgets/account_tile.dart +++ b/packages/neon/neon/lib/src/widgets/account_tile.dart @@ -36,7 +36,7 @@ class NeonAccountTile extends StatelessWidget { leading: NeonUserAvatar( account: account, ), - 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/user_avatar.dart b/packages/neon/neon/lib/src/widgets/user_avatar.dart index 51d38c41..06c677f3 100644 --- a/packages/neon/neon/lib/src/widgets/user_avatar.dart +++ b/packages/neon/neon/lib/src/widgets/user_avatar.dart @@ -72,7 +72,7 @@ class _UserAvatarState extends State { ), ), if (widget.showStatus) ...[ - ResultBuilder( + ResultBuilder( stream: _userStatusBloc.statuses.mapNotNull((final statuses) => statuses[widget.username]), builder: _userStatusIconBuilder, ), @@ -82,7 +82,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 : 3); @@ -127,10 +127,10 @@ class _UserAvatarState extends State { ); } - Color? _userStatusToColor(final NextcloudUserStatusType userStatusType) => switch (userStatusType) { - NextcloudUserStatusType.online => const Color(0xFF49B382), - NextcloudUserStatusType.away => const Color(0xFFF4A331), - NextcloudUserStatusType.dnd => const Color(0xFFED484C), + Color? _userStatusToColor(final UserStatusType userStatusType) => switch (userStatusType) { + UserStatusType.online => const Color(0xFF49B382), + UserStatusType.away => const Color(0xFFF4A331), + UserStatusType.dnd => const Color(0xFFED484C), _ => null, }; } diff --git a/packages/neon/neon_news/lib/blocs/article.dart b/packages/neon/neon_news/lib/blocs/article.dart index c20b39d9..98a4d5b1 100644 --- a/packages/neon/neon_news/lib/blocs/article.dart +++ b/packages/neon/neon_news/lib/blocs/article.dart @@ -20,7 +20,7 @@ class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents, NewsArticleBloc( this._client, this._newsArticlesBloc, - final NextcloudNewsArticle article, + final NewsArticle 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 6e0b8386..74b6c494 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 class NewsArticlesBlocEvents { void setFilterType(final FilterType type); - void markArticleAsRead(final NextcloudNewsArticle article); + void markArticleAsRead(final NewsArticle article); - void markArticleAsUnread(final NextcloudNewsArticle article); + void markArticleAsUnread(final NewsArticle article); - void starArticle(final NextcloudNewsArticle article); + void starArticle(final NewsArticle article); - void unstarArticle(final NextcloudNewsArticle article); + void unstarArticle(final NewsArticle article); } abstract class NewsArticlesBlocStates { - BehaviorSubject>> get articles; + BehaviorSubject>> get articles; BehaviorSubject get filterType; } @@ -72,7 +72,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents } @override - BehaviorSubject>> articles = BehaviorSubject>>(); + BehaviorSubject>> articles = BehaviorSubject>>(); @override BehaviorSubject filterType = BehaviorSubject(); @@ -125,7 +125,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents break; } - await requestManager.wrapNextcloud, NextcloudNewsListArticles>( + await requestManager.wrapNextcloud, NewsListArticles>( client.id, 'news-articles-${type.code}-$id-$getRead', articles, @@ -139,12 +139,12 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents } @override - void markArticleAsRead(final NextcloudNewsArticle article) { + void markArticleAsRead(final NewsArticle article) { wrapAction(() async => client.news.markArticleAsRead(itemId: article.id)); } @override - void markArticleAsUnread(final NextcloudNewsArticle article) { + void markArticleAsUnread(final NewsArticle article) { wrapAction(() async => client.news.markArticleAsUnread(itemId: article.id)); } @@ -154,12 +154,12 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents } @override - void starArticle(final NextcloudNewsArticle article) { + void starArticle(final NewsArticle article) { wrapAction(() async => client.news.starArticle(itemId: article.id)); } @override - void unstarArticle(final NextcloudNewsArticle article) { + void unstarArticle(final NewsArticle article) { wrapAction(() async => 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 2ce6f5fe..bb775bd0 100644 --- a/packages/neon/neon_news/lib/blocs/news.dart +++ b/packages/neon/neon_news/lib/blocs/news.dart @@ -21,9 +21,9 @@ abstract class NewsBlocEvents { } abstract class NewsBlocStates { - BehaviorSubject>> get folders; + BehaviorSubject>> get folders; - BehaviorSubject>> get feeds; + BehaviorSubject>> get feeds; BehaviorSubject get unreadCounter; } @@ -78,16 +78,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; @@ -95,14 +95,14 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates @override Future refresh() async { await Future.wait([ - requestManager.wrapNextcloud, NextcloudNewsListFolders>( + requestManager.wrapNextcloud, NewsListFolders>( client.id, 'news-folders', folders, () async => client.news.listFolders(), (final response) => response.folders.toList(), ), - requestManager.wrapNextcloud, NextcloudNewsListFeeds>( + requestManager.wrapNextcloud, NewsListFeeds>( client.id, 'news-feeds', feeds, @@ -165,12 +165,12 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates } @override - void markArticleAsRead(final NextcloudNewsArticle article) { + void markArticleAsRead(final NewsArticle article) { mainArticlesBloc.markArticleAsRead(article); } @override - void markArticleAsUnread(final NextcloudNewsArticle article) { + void markArticleAsUnread(final NewsArticle article) { mainArticlesBloc.markArticleAsUnread(article); } @@ -180,12 +180,12 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates } @override - void starArticle(final NextcloudNewsArticle article) { + void starArticle(final NewsArticle article) { mainArticlesBloc.starArticle(article); } @override - void unstarArticle(final NextcloudNewsArticle article) { + void unstarArticle(final NewsArticle 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 413a0c57..c1f4fb98 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(); - NextcloudNewsFolder? folder; + NewsFolder? folder; void submit() { if (formKey.currentState!.validate()) { @@ -43,7 +43,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 b81d69b4..225e4b3e 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 NextcloudNewsFeed feed; + final NewsFeed 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 d54550fe..8c851915 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 NextcloudNewsFeed feed; + final NewsFeed 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 c85e65ae..f9d1f6a5 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 NextcloudNewsFeed feed; + final List folders; + final NewsFeed feed; @override State createState() => _NewsMoveFeedDialogState(); @@ -17,7 +17,7 @@ class NewsMoveFeedDialog extends StatefulWidget { class _NewsMoveFeedDialogState extends State { final formKey = GlobalKey(); - NextcloudNewsFolder? folder; + NewsFolder? folder; void submit() { if (formKey.currentState!.validate()) { diff --git a/packages/neon/neon_news/lib/pages/feed.dart b/packages/neon/neon_news/lib/pages/feed.dart index 60175a69..c81f1be8 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 NextcloudNewsFeed feed; + final NewsFeed 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 0aa42ffc..4fbdce45 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 NextcloudNewsFolder folder; + final NewsFolder folder; @override Widget build(final BuildContext context) => Scaffold( diff --git a/packages/neon/neon_news/lib/sort/articles.dart b/packages/neon/neon_news/lib/sort/articles.dart index aa3d32de..ff1087ba 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 ba255596..7425e875 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 435cc6a5..633c5882 100644 --- a/packages/neon/neon_news/lib/sort/folders.dart +++ b/packages/neon/neon_news/lib/sort/folders.dart @@ -11,4 +11,4 @@ final foldersSortBox = SortBox( }, ); -typedef FolderFeedsWrapper = (NextcloudNewsFolder folder, int feedCount, int unreadCount); +typedef FolderFeedsWrapper = (NewsFolder 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 53592444..00553afe 100644 --- a/packages/neon/neon_news/lib/widgets/articles_view.dart +++ b/packages/neon/neon_news/lib/widgets/articles_view.dart @@ -25,16 +25,16 @@ 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, sortPropertyOption: widget.newsBloc.options.articlesSortPropertyOption, sortBoxOrderOption: widget.newsBloc.options.articlesSortBoxOrderOption, input: articles.data, - builder: (final context, final sorted) => NeonListView( + builder: (final context, final sorted) => NeonListView( scrollKey: 'news-articles', items: feeds.hasData ? sorted : null, isLoading: articles.isLoading || feeds.isLoading, @@ -100,8 +100,8 @@ class _NewsArticlesViewState extends State { Widget _buildArticle( final BuildContext context, - final NextcloudNewsArticle article, - final NextcloudNewsFeed feed, + final NewsArticle article, + final NewsFeed 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 28dc64bd..cc0b78d1 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 NextcloudNewsFeed feed; + final NewsFeed 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 79caf501..850e5e83 100644 --- a/packages/neon/neon_news/lib/widgets/feeds_view.dart +++ b/packages/neon/neon_news/lib/widgets/feeds_view.dart @@ -11,18 +11,18 @@ 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, sortPropertyOption: bloc.options.feedsSortPropertyOption, sortBoxOrderOption: bloc.options.feedsSortBoxOrderOption, input: folders.hasData ? feeds.data?.where((final f) => folderID == null || f.folderId == folderID).toList() : null, - builder: (final context, final sorted) => NeonListView( + builder: (final context, final sorted) => NeonListView( scrollKey: 'news-feeds', withFloatingActionButton: true, items: sorted, @@ -41,8 +41,8 @@ class NewsFeedsView extends StatelessWidget { Widget _buildFeed( final BuildContext context, - final NextcloudNewsFeed feed, - final List folders, + final NewsFeed 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 86e40dfa..e8dd9c38 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 void Function(NextcloudNewsFolder?) onChanged; - final NextcloudNewsFolder? value; + final List folders; + final void Function(NewsFolder?) onChanged; + final NewsFolder? 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 bdfcd6b5..ff567b27 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 NextcloudNewsFolder folder; + final NewsFolder 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 aa0b0a25..9fafc7e7 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_notes/lib/blocs/note.dart b/packages/neon/neon_notes/lib/blocs/note.dart index bc206bc3..bc3c06ea 100644 --- a/packages/neon/neon_notes/lib/blocs/note.dart +++ b/packages/neon/neon_notes/lib/blocs/note.dart @@ -17,7 +17,7 @@ class NotesNoteBloc extends InteractiveBloc implements NotesNoteBlocEvents, Note this.options, this._client, this._notesBloc, - final NextcloudNotesNote note, + final NotesNote note, ) { _emitNote(note); id = note.id; @@ -25,13 +25,13 @@ class NotesNoteBloc extends InteractiveBloc implements NotesNoteBlocEvents, Note initialTitle = note.title; } - void _emitNote(final NextcloudNotesNote note) { + void _emitNote(final NotesNote 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 data = await call(_etag); diff --git a/packages/neon/neon_notes/lib/blocs/notes.dart b/packages/neon/neon_notes/lib/blocs/notes.dart index d4a9caa2..01900a31 100644 --- a/packages/neon/neon_notes/lib/blocs/notes.dart +++ b/packages/neon/neon_notes/lib/blocs/notes.dart @@ -19,7 +19,7 @@ abstract class NotesBlocEvents { } abstract class NotesBlocStates { - BehaviorSubject>> get notes; + BehaviorSubject>> get notes; } class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocStates { @@ -42,16 +42,16 @@ class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocSta } @override - BehaviorSubject>> notes = BehaviorSubject>>(); + BehaviorSubject>> notes = BehaviorSubject>>(); @override Future refresh() async { - await requestManager.wrapNextcloud, BuiltList>( + await requestManager.wrapNextcloud, BuiltList>( client.id, 'notes-notes', notes, () async => client.notes.getNotes(), - List.from, + List.from, ); } diff --git a/packages/neon/neon_notes/lib/dialogs/create_note.dart b/packages/neon/neon_notes/lib/dialogs/create_note.dart index d30a1fc2..0fb0d02c 100644 --- a/packages/neon/neon_notes/lib/dialogs/create_note.dart +++ b/packages/neon/neon_notes/lib/dialogs/create_note.dart @@ -26,7 +26,7 @@ class _NotesCreateNoteDialogState extends State { } @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( stream: widget.bloc.notes, builder: (final context, final notes) => NeonDialog( title: Text(AppLocalizations.of(context).noteCreate), diff --git a/packages/neon/neon_notes/lib/dialogs/select_category.dart b/packages/neon/neon_notes/lib/dialogs/select_category.dart index 09fea8a8..2cec920e 100644 --- a/packages/neon/neon_notes/lib/dialogs/select_category.dart +++ b/packages/neon/neon_notes/lib/dialogs/select_category.dart @@ -26,7 +26,7 @@ class _NotesSelectCategoryDialogState extends State { } @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( stream: widget.bloc.notes, builder: (final context, final notes) => NeonDialog( title: Text(AppLocalizations.of(context).category), diff --git a/packages/neon/neon_notes/lib/sort/notes.dart b/packages/neon/neon_notes/lib/sort/notes.dart index 6ac33921..137dcdfb 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 e3f13d52..2522cab6 100644 --- a/packages/neon/neon_notes/lib/widgets/categories_view.dart +++ b/packages/neon/neon_notes/lib/widgets/categories_view.dart @@ -9,7 +9,7 @@ class NotesCategoriesView extends StatelessWidget { final NotesBloc bloc; @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( stream: bloc.notes, builder: (final context, final notes) => SortBoxBuilder( sortBox: categoriesSortBox, diff --git a/packages/neon/neon_notes/lib/widgets/notes_view.dart b/packages/neon/neon_notes/lib/widgets/notes_view.dart index 3bfab4d4..5bc2409c 100644 --- a/packages/neon/neon_notes/lib/widgets/notes_view.dart +++ b/packages/neon/neon_notes/lib/widgets/notes_view.dart @@ -11,23 +11,23 @@ class NotesView extends StatelessWidget { final String? category; @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( stream: bloc.notes, - builder: (final context, final notes) => SortBoxBuilder( + builder: (final context, final notes) => SortBoxBuilder( sortBox: notesSortBox, sortPropertyOption: bloc.options.notesSortPropertyOption, sortBoxOrderOption: bloc.options.notesSortBoxOrderOption, input: category != null ? notes.data?.where((final note) => note.favorite && note.category == category).toList() : notes.data?.where((final note) => note.favorite).toList(), - builder: (final context, final sortedFavorites) => SortBoxBuilder( + builder: (final context, final sortedFavorites) => SortBoxBuilder( sortBox: notesSortBox, sortPropertyOption: bloc.options.notesSortPropertyOption, sortBoxOrderOption: bloc.options.notesSortBoxOrderOption, input: category != null ? notes.data?.where((final note) => !note.favorite && note.category == category).toList() : notes.data?.where((final note) => !note.favorite).toList(), - builder: (final context, final sortedNonFavorites) => NeonListView( + builder: (final context, final sortedNonFavorites) => NeonListView( scrollKey: 'notes-notes', withFloatingActionButton: true, items: [ @@ -45,7 +45,7 @@ class NotesView extends StatelessWidget { Widget _buildNote( final BuildContext context, - final NextcloudNotesNote note, + final NotesNote note, ) => ListTile( title: Text(note.title), diff --git a/packages/neon/neon_notifications/lib/blocs/notifications.dart b/packages/neon/neon_notifications/lib/blocs/notifications.dart index c47da43b..cb683e67 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 notifications; BehaviorSubject get unreadCounter; } @@ -41,16 +41,15 @@ class NotificationsBloc extends InteractiveBloc } @override - BehaviorSubject>> notifications = - BehaviorSubject>>(); + BehaviorSubject>> notifications = + BehaviorSubject>>(); @override BehaviorSubject unreadCounter = BehaviorSubject(); @override Future refresh() async { - await _requestManager - .wrapNextcloud, NextcloudNotificationsListNotifications>( + await _requestManager.wrapNextcloud, NotificationsListNotifications>( _client.id, 'notifications-notifications', notifications, diff --git a/packages/neon/neon_notifications/lib/pages/main.dart b/packages/neon/neon_notifications/lib/pages/main.dart index 948b0d5b..683953c5 100644 --- a/packages/neon/neon_notifications/lib/pages/main.dart +++ b/packages/neon/neon_notifications/lib/pages/main.dart @@ -24,7 +24,7 @@ class _NotificationsMainPageState extends State { } @override - Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( + Widget build(final BuildContext context) => ResultBuilder>.behaviorSubject( stream: bloc.notifications, builder: (final context, final notifications) => Scaffold( resizeToAvoidBottomInset: false, @@ -35,7 +35,7 @@ class _NotificationsMainPageState extends State { tooltip: AppLocalizations.of(context).notificationsDismissAll, child: Icon(MdiIcons.checkAll), ), - body: NeonListView( + body: NeonListView( scrollKey: 'notifications-notifications', withFloatingActionButton: true, items: notifications.data, @@ -49,7 +49,7 @@ class _NotificationsMainPageState extends State { Widget _buildNotification( final BuildContext context, - final NextcloudNotificationsNotification notification, + final NotificationsNotification notification, ) { final app = Provider.of>(context, listen: false).tryFind(notification.app);