Browse Source

Merge pull request #254 from Leptopoda/fix/built_value/neon

migrate neon fix
pull/269/head
Kate 2 years ago committed by GitHub
parent
commit
0d03b51bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      packages/neon/lib/src/apps/news/blocs/articles.dart
  2. 8
      packages/neon/lib/src/apps/news/blocs/news.dart
  3. 4
      packages/neon/lib/src/apps/notes/blocs/notes.dart
  4. 4
      packages/neon/lib/src/apps/notifications/blocs/notifications.dart
  5. 4
      packages/neon/lib/src/blocs/apps.dart

4
packages/neon/lib/src/apps/news/blocs/articles.dart

@ -125,7 +125,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
break; break;
} }
await requestManager.wrapNextcloud<Iterable<NextcloudNewsArticle>, NextcloudNewsListArticles>( await requestManager.wrapNextcloud<List<NextcloudNewsArticle>, NextcloudNewsListArticles>(
client.id, client.id,
'news-articles-${type.code}-$id-$getRead', 'news-articles-${type.code}-$id-$getRead',
articles, articles,
@ -134,7 +134,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
id: id ?? 0, id: id ?? 0,
getRead: getRead ?? true ? 1 : 0, getRead: getRead ?? true ? 1 : 0,
), ),
(final response) => response.items, (final response) => response.items.toList(),
); );
} }

8
packages/neon/lib/src/apps/news/blocs/news.dart

@ -94,14 +94,14 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates
@override @override
Future refresh() async { Future refresh() async {
await Future.wait([ await Future.wait([
requestManager.wrapNextcloud<Iterable<NextcloudNewsFolder>, NextcloudNewsListFolders>( requestManager.wrapNextcloud<List<NextcloudNewsFolder>, NextcloudNewsListFolders>(
client.id, client.id,
'news-folders', 'news-folders',
folders, folders,
() async => client.news.listFolders(), () async => client.news.listFolders(),
(final response) => response.folders, (final response) => response.folders.toList(),
), ),
requestManager.wrapNextcloud<Iterable<NextcloudNewsFeed>, NextcloudNewsListFeeds>( requestManager.wrapNextcloud<List<NextcloudNewsFeed>, NextcloudNewsListFeeds>(
client.id, client.id,
'news-feeds', 'news-feeds',
feeds, feeds,
@ -111,7 +111,7 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates
if (response.newestItemId != null) { if (response.newestItemId != null) {
_newestItemId = response.newestItemId!; _newestItemId = response.newestItemId!;
} }
return response.feeds; return response.feeds.toList();
}, },
), ),
mainArticlesBloc.reload(), mainArticlesBloc.reload(),

4
packages/neon/lib/src/apps/notes/blocs/notes.dart

@ -46,12 +46,12 @@ class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocSta
@override @override
Future refresh() async { Future refresh() async {
await requestManager.wrapNextcloud<Iterable<NextcloudNotesNote>, Iterable<NextcloudNotesNote>>( await requestManager.wrapNextcloud<List<NextcloudNotesNote>, Iterable<NextcloudNotesNote>>(
client.id, client.id,
'notes-notes', 'notes-notes',
notes, notes,
() async => client.notes.getNotes(), () async => client.notes.getNotes(),
(final response) => response, (final response) => response.toList(),
); );
} }

4
packages/neon/lib/src/apps/notifications/blocs/notifications.dart

@ -48,12 +48,12 @@ class NotificationsBloc extends InteractiveBloc implements NotificationsBlocEven
@override @override
Future refresh() async { Future refresh() async {
await _requestManager await _requestManager
.wrapNextcloud<Iterable<NextcloudNotificationsNotification>, NextcloudNotificationsListNotifications>( .wrapNextcloud<List<NextcloudNotificationsNotification>, NextcloudNotificationsListNotifications>(
_client.id, _client.id,
'notifications-notifications', 'notifications-notifications',
notifications, notifications,
() async => _client.notifications.listNotifications(), () async => _client.notifications.listNotifications(),
(final response) => response.ocs.data, (final response) => response.ocs.data.toList(),
); );
} }

4
packages/neon/lib/src/blocs/apps.dart

@ -115,12 +115,12 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
@override @override
Future refresh() async { Future refresh() async {
await _requestManager.wrapNextcloud<Iterable<NextcloudApp>, NextcloudCoreNavigationApps>( await _requestManager.wrapNextcloud<List<NextcloudApp>, NextcloudCoreNavigationApps>(
_account.client.id, _account.client.id,
'apps-apps', 'apps-apps',
apps, apps,
() async => _account.client.core.getNavigationApps(), () async => _account.client.core.getNavigationApps(),
(final response) => response.ocs.data, (final response) => response.ocs.data.toList(),
); );
} }

Loading…
Cancel
Save