Browse Source

neon: migrate to built_value

Signed-off-by: Nikolas Rimikis <rimikis.nikolas@gmail.com>
pull/194/head
Nikolas Rimikis 2 years ago
parent
commit
c84c5a8402
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 31
      packages/app/pubspec.lock
  2. 2
      packages/neon/neon/lib/src/blocs/apps.dart
  3. 2
      packages/neon/neon/lib/src/utils/request_manager.dart
  4. 2
      packages/neon/neon_news/lib/blocs/articles.dart
  5. 4
      packages/neon/neon_news/lib/blocs/news.dart
  6. 4
      packages/neon/neon_notes/lib/blocs/notes.dart
  7. 2
      packages/neon/neon_notifications/lib/blocs/notifications.dart

31
packages/app/pubspec.lock

@ -41,6 +41,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
built_collection:
dependency: transitive
description:
name: built_collection
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
url: "https://pub.dev"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
sha256: "2f17434bd5d52a26762043d6b43bb53b3acd029b4d9071a329f46d67ef297e6d"
url: "https://pub.dev"
source: hosted
version: "8.5.0"
characters:
dependency: transitive
description:
@ -121,6 +137,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.8"
dynamite_runtime:
dependency: transitive
description:
path: "../dynamite/dynamite_runtime"
relative: true
source: path
version: "1.0.0"
fake_async:
dependency: transitive
description:
@ -168,6 +191,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.1"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
flutter:
dependency: "direct main"
description: flutter

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

@ -120,7 +120,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
'apps-apps',
apps,
() async => _account.client.core.getNavigationApps(),
(final response) => response.ocs.data,
(final response) => response.ocs.data.toList(),
);
}

2
packages/neon/neon/lib/src/utils/request_manager.dart

@ -23,7 +23,7 @@ class RequestManager {
call,
unwrap,
(final data) => json.encode(serializeNextcloud<R>(data)),
(final data) => deserializeNextcloud<R>(json.decode(data)),
(final data) => deserializeNextcloud<R>(json.decode(data) as Object),
disableTimeout,
emitEmptyCache,
0,

2
packages/neon/neon_news/lib/blocs/articles.dart

@ -134,7 +134,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
id: id ?? 0,
getRead: getRead ?? true ? 1 : 0,
),
(final response) => response.items,
(final response) => response.items.toList(),
);
}

4
packages/neon/neon_news/lib/blocs/news.dart

@ -99,7 +99,7 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates
'news-folders',
folders,
() async => client.news.listFolders(),
(final response) => response.folders,
(final response) => response.folders.toList(),
),
requestManager.wrapNextcloud<List<NextcloudNewsFeed>, NextcloudNewsListFeeds>(
client.id,
@ -111,7 +111,7 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates
if (response.newestItemId != null) {
_newestItemId = response.newestItemId!;
}
return response.feeds;
return response.feeds.toList();
},
),
mainArticlesBloc.reload(),

4
packages/neon/neon_notes/lib/blocs/notes.dart

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

2
packages/neon/neon_notifications/lib/blocs/notifications.dart

@ -52,7 +52,7 @@ class NotificationsBloc extends NotificationsBlocInterface implements Notificati
'notifications-notifications',
notifications,
() async => _client.notifications.listNotifications(),
(final response) => response.ocs.data,
(final response) => response.ocs.data.toList(),
);
}

Loading…
Cancel
Save