|
|
@ -21,9 +21,9 @@ abstract class NewsBlocEvents { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
abstract class NewsBlocStates { |
|
|
|
abstract class NewsBlocStates { |
|
|
|
BehaviorSubject<Result<List<NextcloudNewsFolder>>> get folders; |
|
|
|
BehaviorSubject<Result<List<NewsFolder>>> get folders; |
|
|
|
|
|
|
|
|
|
|
|
BehaviorSubject<Result<List<NextcloudNewsFeed>>> get feeds; |
|
|
|
BehaviorSubject<Result<List<NewsFeed>>> get feeds; |
|
|
|
|
|
|
|
|
|
|
|
BehaviorSubject<int> get unreadCounter; |
|
|
|
BehaviorSubject<int> get unreadCounter; |
|
|
|
} |
|
|
|
} |
|
|
@ -78,16 +78,16 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
BehaviorSubject<Result<List<NextcloudNewsFeed>>> feeds = BehaviorSubject<Result<List<NextcloudNewsFeed>>>(); |
|
|
|
BehaviorSubject<Result<List<NewsFeed>>> feeds = BehaviorSubject<Result<List<NewsFeed>>>(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
BehaviorSubject<Result<List<NextcloudNewsFolder>>> folders = BehaviorSubject<Result<List<NextcloudNewsFolder>>>(); |
|
|
|
BehaviorSubject<Result<List<NewsFolder>>> folders = BehaviorSubject<Result<List<NewsFolder>>>(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
BehaviorSubject<int> unreadCounter = BehaviorSubject<int>(); |
|
|
|
BehaviorSubject<int> unreadCounter = BehaviorSubject<int>(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
late BehaviorSubject<Result<List<NextcloudNewsArticle>>> articles = mainArticlesBloc.articles; |
|
|
|
late BehaviorSubject<Result<List<NewsArticle>>> articles = mainArticlesBloc.articles; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
late BehaviorSubject<FilterType> filterType = mainArticlesBloc.filterType; |
|
|
|
late BehaviorSubject<FilterType> filterType = mainArticlesBloc.filterType; |
|
|
@ -95,14 +95,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<List<NewsFolder>, NewsListFolders>( |
|
|
|
client.id, |
|
|
|
client.id, |
|
|
|
'news-folders', |
|
|
|
'news-folders', |
|
|
|
folders, |
|
|
|
folders, |
|
|
|
() async => client.news.listFolders(), |
|
|
|
() async => client.news.listFolders(), |
|
|
|
(final response) => response.folders.toList(), |
|
|
|
(final response) => response.folders.toList(), |
|
|
|
), |
|
|
|
), |
|
|
|
requestManager.wrapNextcloud<List<NextcloudNewsFeed>, NextcloudNewsListFeeds>( |
|
|
|
requestManager.wrapNextcloud<List<NewsFeed>, NewsListFeeds>( |
|
|
|
client.id, |
|
|
|
client.id, |
|
|
|
'news-feeds', |
|
|
|
'news-feeds', |
|
|
|
feeds, |
|
|
|
feeds, |
|
|
@ -165,12 +165,12 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void markArticleAsRead(final NextcloudNewsArticle article) { |
|
|
|
void markArticleAsRead(final NewsArticle article) { |
|
|
|
mainArticlesBloc.markArticleAsRead(article); |
|
|
|
mainArticlesBloc.markArticleAsRead(article); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void markArticleAsUnread(final NextcloudNewsArticle article) { |
|
|
|
void markArticleAsUnread(final NewsArticle article) { |
|
|
|
mainArticlesBloc.markArticleAsUnread(article); |
|
|
|
mainArticlesBloc.markArticleAsUnread(article); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -180,12 +180,12 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void starArticle(final NextcloudNewsArticle article) { |
|
|
|
void starArticle(final NewsArticle article) { |
|
|
|
mainArticlesBloc.starArticle(article); |
|
|
|
mainArticlesBloc.starArticle(article); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void unstarArticle(final NextcloudNewsArticle article) { |
|
|
|
void unstarArticle(final NewsArticle article) { |
|
|
|
mainArticlesBloc.unstarArticle(article); |
|
|
|
mainArticlesBloc.unstarArticle(article); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|