Browse Source

migrate neon

pull/252/head
Nikolas Rimikis 2 years ago
parent
commit
80cc2e422c
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 2
      packages/neon/lib/src/apps/news/blocs/articles.dart
  2. 4
      packages/neon/lib/src/apps/news/blocs/news.dart
  3. 2
      packages/neon/lib/src/apps/notes/blocs/notes.dart
  4. 2
      packages/neon/lib/src/apps/notifications/blocs/notifications.dart
  5. 2
      packages/neon/lib/src/blocs/apps.dart
  6. 6
      packages/neon/lib/src/utils/request_manager.dart
  7. 4
      packages/neon/pubspec.lock

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

@ -125,7 +125,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
break;
}
await requestManager.wrapNextcloud<List<NextcloudNewsArticle>, NextcloudNewsListArticles>(
await requestManager.wrapNextcloud<Iterable<NextcloudNewsArticle>, NextcloudNewsListArticles>(
client.id,
'news-articles-${type.code}-$id-$getRead',
articles,

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

@ -94,14 +94,14 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates
@override
Future refresh() async {
await Future.wait([
requestManager.wrapNextcloud<List<NextcloudNewsFolder>, NextcloudNewsListFolders>(
requestManager.wrapNextcloud<Iterable<NextcloudNewsFolder>, NextcloudNewsListFolders>(
client.id,
'news-folders',
folders,
() async => client.news.listFolders(),
(final response) => response.folders,
),
requestManager.wrapNextcloud<List<NextcloudNewsFeed>, NextcloudNewsListFeeds>(
requestManager.wrapNextcloud<Iterable<NextcloudNewsFeed>, NextcloudNewsListFeeds>(
client.id,
'news-feeds',
feeds,

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

@ -46,7 +46,7 @@ class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocSta
@override
Future refresh() async {
await requestManager.wrapNextcloud<List<NextcloudNotesNote>, List<NextcloudNotesNote>>(
await requestManager.wrapNextcloud<Iterable<NextcloudNotesNote>, Iterable<NextcloudNotesNote>>(
client.id,
'notes-notes',
notes,

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

@ -48,7 +48,7 @@ class NotificationsBloc extends InteractiveBloc implements NotificationsBlocEven
@override
Future refresh() async {
await _requestManager
.wrapNextcloud<List<NextcloudNotificationsNotification>, NextcloudNotificationsListNotifications>(
.wrapNextcloud<Iterable<NextcloudNotificationsNotification>, NextcloudNotificationsListNotifications>(
_client.id,
'notifications-notifications',
notifications,

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

@ -115,7 +115,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
@override
Future refresh() async {
await _requestManager.wrapNextcloud<List<NextcloudApp>, NextcloudCoreNavigationApps>(
await _requestManager.wrapNextcloud<Iterable<NextcloudApp>, NextcloudCoreNavigationApps>(
_account.client.id,
'apps-apps',
apps,

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

@ -34,7 +34,7 @@ class RequestManager {
try {
subject.add(
Result(
unwrap(deserializeNextcloud<R>(json.decode((await cache!.get(key))!))),
unwrap(deserializeNextcloud<R>(json.decode((await cache!.get(key))!) as Object)),
null,
loading: true,
cached: true,
@ -48,7 +48,7 @@ class RequestManager {
try {
final response = await (disableTimeout ? call() : timeout(call));
await cache?.set(key, json.encode(serializeNextcloud<R>(response)));
await cache?.set(key, json.encode(response, toEncodable: serializeNextcloud));
subject.add(Result.success(unwrap(response)));
} catch (e, s) {
debugPrint(e.toString());
@ -57,7 +57,7 @@ class RequestManager {
try {
subject.add(
Result(
unwrap(deserializeNextcloud<R>(json.decode((await cache!.get(key))!))),
unwrap(deserializeNextcloud<R>(json.decode((await cache!.get(key))!) as Object)),
null,
loading: false,
cached: true,

4
packages/neon/pubspec.lock

@ -117,10 +117,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: "169565c8ad06adb760c3645bf71f00bff161b00002cace266cad42c5d22a7725"
sha256: "31b7c748fd4b9adf8d25d72a4c4a59ef119f12876cf414f94f8af5131d5fa2b0"
url: "https://pub.dev"
source: hosted
version: "8.4.3"
version: "8.4.4"
characters:
dependency: transitive
description:

Loading…
Cancel
Save