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; break;
} }
await requestManager.wrapNextcloud<List<NextcloudNewsArticle>, NextcloudNewsListArticles>( await requestManager.wrapNextcloud<Iterable<NextcloudNewsArticle>, NextcloudNewsListArticles>(
client.id, client.id,
'news-articles-${type.code}-$id-$getRead', 'news-articles-${type.code}-$id-$getRead',
articles, articles,

4
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<List<NextcloudNewsFolder>, NextcloudNewsListFolders>( requestManager.wrapNextcloud<Iterable<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,
), ),
requestManager.wrapNextcloud<List<NextcloudNewsFeed>, NextcloudNewsListFeeds>( requestManager.wrapNextcloud<Iterable<NextcloudNewsFeed>, NextcloudNewsListFeeds>(
client.id, client.id,
'news-feeds', 'news-feeds',
feeds, feeds,

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

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

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

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

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

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

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

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

4
packages/neon/pubspec.lock

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

Loading…
Cancel
Save