Browse Source

neon,neon_news,neon_notes,neon_notifications: Adjust

pull/439/head
jld3103 2 years ago
parent
commit
03149d9e58
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 4
      packages/neon/neon/lib/src/blocs/apps.dart
  2. 6
      packages/neon/neon/lib/src/blocs/capabilities.dart
  3. 10
      packages/neon/neon/lib/src/blocs/login.dart
  4. 2
      packages/neon/neon/lib/src/blocs/next_push.dart
  5. 8
      packages/neon/neon/lib/src/blocs/user_details.dart
  6. 20
      packages/neon/neon/lib/src/blocs/user_statuses.dart
  7. 2
      packages/neon/neon/lib/src/models/push_notification.dart
  8. 2
      packages/neon/neon/lib/src/models/push_notification.g.dart
  9. 2
      packages/neon/neon/lib/src/pages/account_settings.dart
  10. 2
      packages/neon/neon/lib/src/utils/push_utils.dart
  11. 2
      packages/neon/neon/lib/src/utils/theme.dart
  12. 2
      packages/neon/neon/lib/src/widgets/account_tile.dart
  13. 12
      packages/neon/neon/lib/src/widgets/user_avatar.dart
  14. 2
      packages/neon/neon_news/lib/blocs/article.dart
  15. 22
      packages/neon/neon_news/lib/blocs/articles.dart
  16. 22
      packages/neon/neon_news/lib/blocs/news.dart
  17. 4
      packages/neon/neon_news/lib/dialogs/add_feed.dart
  18. 2
      packages/neon/neon_news/lib/dialogs/feed_show_url.dart
  19. 2
      packages/neon/neon_news/lib/dialogs/feed_update_error.dart
  20. 6
      packages/neon/neon_news/lib/dialogs/move_feed.dart
  21. 2
      packages/neon/neon_news/lib/pages/feed.dart
  22. 2
      packages/neon/neon_news/lib/pages/folder.dart
  23. 2
      packages/neon/neon_news/lib/sort/articles.dart
  24. 2
      packages/neon/neon_news/lib/sort/feeds.dart
  25. 2
      packages/neon/neon_news/lib/sort/folders.dart
  26. 12
      packages/neon/neon_news/lib/widgets/articles_view.dart
  27. 2
      packages/neon/neon_news/lib/widgets/feed_icon.dart
  28. 12
      packages/neon/neon_news/lib/widgets/feeds_view.dart
  29. 10
      packages/neon/neon_news/lib/widgets/folder_select.dart
  30. 2
      packages/neon/neon_news/lib/widgets/folder_view.dart
  31. 4
      packages/neon/neon_news/lib/widgets/folders_view.dart
  32. 6
      packages/neon/neon_notes/lib/blocs/note.dart
  33. 8
      packages/neon/neon_notes/lib/blocs/notes.dart
  34. 2
      packages/neon/neon_notes/lib/dialogs/create_note.dart
  35. 2
      packages/neon/neon_notes/lib/dialogs/select_category.dart
  36. 2
      packages/neon/neon_notes/lib/sort/notes.dart
  37. 2
      packages/neon/neon_notes/lib/widgets/categories_view.dart
  38. 10
      packages/neon/neon_notes/lib/widgets/notes_view.dart
  39. 9
      packages/neon/neon_notifications/lib/blocs/notifications.dart
  40. 6
      packages/neon/neon_notifications/lib/pages/main.dart

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

@ -1,6 +1,6 @@
part of 'blocs.dart';
typedef NextcloudApp = NextcloudCoreNavigationApps_Ocs_Data;
typedef NextcloudApp = CoreNavigationApps_Ocs_Data;
abstract class AppsBlocEvents {
void setActiveApp(final String appID);
@ -165,7 +165,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
@override
Future refresh() async {
await _requestManager.wrapNextcloud<List<NextcloudApp>, NextcloudCoreNavigationApps>(
await _requestManager.wrapNextcloud<List<NextcloudApp>, CoreNavigationApps>(
_account.client.id,
'apps-apps',
apps,

6
packages/neon/neon/lib/src/blocs/capabilities.dart

@ -1,7 +1,7 @@
part of 'blocs.dart';
typedef Capabilities = NextcloudCoreServerCapabilities_Ocs_Data;
typedef NextcloudTheme = NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_Theming;
typedef Capabilities = CoreServerCapabilities_Ocs_Data;
typedef NextcloudTheme = CoreServerCapabilities_Ocs_Data_Capabilities_Theming;
abstract class CapabilitiesBlocEvents {}
@ -31,7 +31,7 @@ class CapabilitiesBloc extends InteractiveBloc implements CapabilitiesBlocEvents
@override
Future refresh() async {
await _requestManager.wrapNextcloud<NextcloudCoreServerCapabilities_Ocs_Data, NextcloudCoreServerCapabilities>(
await _requestManager.wrapNextcloud<CoreServerCapabilities_Ocs_Data, CoreServerCapabilities>(
_client.id,
'capabilities',
capabilities,

10
packages/neon/neon/lib/src/blocs/login.dart

@ -9,9 +9,9 @@ abstract class LoginBlocStates {
BehaviorSubject<ServerConnectionState?> get serverConnectionState;
BehaviorSubject<NextcloudCoreLoginFlowInit?> get loginFlowInit;
BehaviorSubject<CoreLoginFlowInit?> get loginFlowInit;
BehaviorSubject<NextcloudCoreLoginFlowResult?> get loginFlowResult;
BehaviorSubject<CoreLoginFlowResult?> get loginFlowResult;
}
class LoginBloc extends InteractiveBloc implements LoginBlocEvents, LoginBlocStates {
@ -31,12 +31,10 @@ class LoginBloc extends InteractiveBloc implements LoginBlocEvents, LoginBlocSta
}
@override
BehaviorSubject<NextcloudCoreLoginFlowInit?> loginFlowInit =
BehaviorSubject<NextcloudCoreLoginFlowInit?>.seeded(null);
BehaviorSubject<CoreLoginFlowInit?> loginFlowInit = BehaviorSubject<CoreLoginFlowInit?>.seeded(null);
@override
BehaviorSubject<NextcloudCoreLoginFlowResult?> loginFlowResult =
BehaviorSubject<NextcloudCoreLoginFlowResult?>.seeded(null);
BehaviorSubject<CoreLoginFlowResult?> loginFlowResult = BehaviorSubject<CoreLoginFlowResult?>.seeded(null);
@override
BehaviorSubject<ServerConnectionState?> serverConnectionState = BehaviorSubject<ServerConnectionState?>.seeded(null);

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

@ -39,7 +39,7 @@ class NextPushBloc extends Bloc implements NextPushBlocEvents, NextPushBlocState
for (final account in _accountsBloc.accounts.value) {
if (!_supported.containsKey(account)) {
try {
_supported[account] = (await account.client.unifiedPushProvider.check()).success;
_supported[account] = (await account.client.uppush.check()).success;
} catch (e, s) {
debugPrint(e.toString());
debugPrint(s.toString());

8
packages/neon/neon/lib/src/blocs/user_details.dart

@ -3,7 +3,7 @@ part of 'blocs.dart';
abstract class UserDetailsBlocEvents {}
abstract class UserDetailsBlocStates {
BehaviorSubject<Result<NextcloudProvisioningApiUserDetails>> get userDetails;
BehaviorSubject<Result<ProvisioningApiUserDetails>> get userDetails;
}
class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents, UserDetailsBlocStates {
@ -24,12 +24,12 @@ class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents,
}
@override
BehaviorSubject<Result<NextcloudProvisioningApiUserDetails>> userDetails =
BehaviorSubject<Result<NextcloudProvisioningApiUserDetails>>();
BehaviorSubject<Result<ProvisioningApiUserDetails>> userDetails =
BehaviorSubject<Result<ProvisioningApiUserDetails>>();
@override
Future refresh() async {
await _requestManager.wrapNextcloud<NextcloudProvisioningApiUserDetails, NextcloudProvisioningApiUser>(
await _requestManager.wrapNextcloud<ProvisioningApiUserDetails, ProvisioningApiUser>(
_client.id,
'user-details',
userDetails,

20
packages/neon/neon/lib/src/blocs/user_statuses.dart

@ -5,7 +5,7 @@ abstract class UserStatusesBlocEvents {
}
abstract class UserStatusesBlocStates {
BehaviorSubject<Map<String, Result<NextcloudUserStatusPublicStatus?>>> get statuses;
BehaviorSubject<Map<String, Result<UserStatusPublicStatus?>>> get statuses;
}
class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents, UserStatusesBlocStates {
@ -29,8 +29,8 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents
}
@override
BehaviorSubject<Map<String, Result<NextcloudUserStatusPublicStatus?>>> statuses =
BehaviorSubject<Map<String, Result<NextcloudUserStatusPublicStatus?>>>();
BehaviorSubject<Map<String, Result<UserStatusPublicStatus?>>> statuses =
BehaviorSubject<Map<String, Result<UserStatusPublicStatus?>>>();
@override
Future refresh() async {
@ -48,17 +48,17 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents
try {
_updateStatus(username, Result.loading());
NextcloudUserStatusPublicStatus? data;
UserStatusPublicStatus? data;
if (_account.username == username) {
final isAway =
_platform.canUseWindowManager && (!(await windowManager.isFocused()) || !(await windowManager.isVisible()));
final response = await _account.client.userStatus.heartbeat(
status: isAway ? NextcloudUserStatusType.away : NextcloudUserStatusType.online,
status: isAway ? UserStatusType.away : UserStatusType.online,
);
data = response.ocs.data.userStatusStatus?.userStatusPublicStatus;
data = response.ocs.data.status?.publicStatus;
} else {
final response = await _account.client.userStatus.getPublicStatus(userId: username);
data = response.ocs.data.userStatusPublicStatus;
data = response.ocs.data.publicStatus;
}
_updateStatus(username, Result.success(data));
@ -73,10 +73,10 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents
}
}
Map<String, Result<NextcloudUserStatusPublicStatus?>> get _statuses =>
statuses.valueOrNull ?? <String, Result<NextcloudUserStatusPublicStatus?>>{};
Map<String, Result<UserStatusPublicStatus?>> get _statuses =>
statuses.valueOrNull ?? <String, Result<UserStatusPublicStatus?>>{};
void _updateStatus(final String username, final Result<NextcloudUserStatusPublicStatus?> result) {
void _updateStatus(final String username, final Result<UserStatusPublicStatus?> result) {
statuses.add({
..._statuses,
username: result,

2
packages/neon/neon/lib/src/models/push_notification.dart

@ -23,5 +23,5 @@ class PushNotification {
final String type;
final NextcloudNotificationsNotificationDecryptedSubject subject;
final NotificationsNotificationDecryptedSubject subject;
}

2
packages/neon/neon/lib/src/models/push_notification.g.dart

@ -10,7 +10,7 @@ PushNotification _$PushNotificationFromJson(Map<String, dynamic> json) => PushNo
accountID: json['accountID'] as String,
priority: json['priority'] as String,
type: json['type'] as String,
subject: NextcloudNotificationsNotificationDecryptedSubject.fromJson(json['subject'] as Map<String, dynamic>),
subject: NotificationsNotificationDecryptedSubject.fromJson(json['subject'] as Map<String, dynamic>),
);
Map<String, dynamic> _$PushNotificationToJson(PushNotification instance) => <String, dynamic>{

2
packages/neon/neon/lib/src/pages/account_settings.dart

@ -59,7 +59,7 @@ class AccountSettingsPage extends StatelessWidget {
),
],
),
body: ResultBuilder<NextcloudProvisioningApiUserDetails>.behaviorSubject(
body: ResultBuilder<ProvisioningApiUserDetails>.behaviorSubject(
stream: _userDetailsBloc.userDetails,
builder: (final context, final userDetails) => SettingsList(
categories: [

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

@ -78,7 +78,7 @@ class PushUtils {
var accounts = <Account>[];
Account? account;
NextcloudNotificationsNotification? notification;
NotificationsNotification? notification;
AndroidBitmap<Object>? largeIconBitmap;
try {
accounts = loadAccounts(AppStorage('accounts', sharedPreferences));

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

@ -3,7 +3,7 @@ part of '../../neon.dart';
const themePrimaryColor = Color(0xFFF37736);
ThemeData getThemeFromNextcloudTheme(
final NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_Theming? nextcloudTheme,
final CoreServerCapabilities_Ocs_Data_Capabilities_Theming? nextcloudTheme,
final Brightness brightness, {
required final bool keepOriginalAccentColor,
final bool oledAsDark = false,

2
packages/neon/neon/lib/src/widgets/account_tile.dart

@ -36,7 +36,7 @@ class NeonAccountTile extends StatelessWidget {
leading: NeonUserAvatar(
account: account,
),
title: ResultBuilder<NextcloudProvisioningApiUserDetails>.behaviorSubject(
title: ResultBuilder<ProvisioningApiUserDetails>.behaviorSubject(
stream: userDetailsBloc.userDetails,
builder: (final context, final userDetails) => Row(
children: [

12
packages/neon/neon/lib/src/widgets/user_avatar.dart

@ -72,7 +72,7 @@ class _UserAvatarState extends State<NeonUserAvatar> {
),
),
if (widget.showStatus) ...[
ResultBuilder<NextcloudUserStatusPublicStatus?>(
ResultBuilder<UserStatusPublicStatus?>(
stream: _userStatusBloc.statuses.mapNotNull((final statuses) => statuses[widget.username]),
builder: _userStatusIconBuilder,
),
@ -82,7 +82,7 @@ class _UserAvatarState extends State<NeonUserAvatar> {
},
);
Widget _userStatusIconBuilder(final BuildContext context, final Result<NextcloudUserStatusPublicStatus?> result) {
Widget _userStatusIconBuilder(final BuildContext context, final Result<UserStatusPublicStatus?> result) {
final hasEmoji = result.data?.icon != null;
final scaledSize = size / (hasEmoji ? 2 : 3);
@ -127,10 +127,10 @@ class _UserAvatarState extends State<NeonUserAvatar> {
);
}
Color? _userStatusToColor(final NextcloudUserStatusType userStatusType) => switch (userStatusType) {
NextcloudUserStatusType.online => const Color(0xFF49B382),
NextcloudUserStatusType.away => const Color(0xFFF4A331),
NextcloudUserStatusType.dnd => const Color(0xFFED484C),
Color? _userStatusToColor(final UserStatusType userStatusType) => switch (userStatusType) {
UserStatusType.online => const Color(0xFF49B382),
UserStatusType.away => const Color(0xFFF4A331),
UserStatusType.dnd => const Color(0xFFED484C),
_ => null,
};
}

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

@ -20,7 +20,7 @@ class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents,
NewsArticleBloc(
this._client,
this._newsArticlesBloc,
final NextcloudNewsArticle article,
final NewsArticle article,
) {
_id = article.id;
unread.add(article.unread);

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

@ -14,17 +14,17 @@ enum ListType {
abstract class NewsArticlesBlocEvents {
void setFilterType(final FilterType type);
void markArticleAsRead(final NextcloudNewsArticle article);
void markArticleAsRead(final NewsArticle article);
void markArticleAsUnread(final NextcloudNewsArticle article);
void markArticleAsUnread(final NewsArticle article);
void starArticle(final NextcloudNewsArticle article);
void starArticle(final NewsArticle article);
void unstarArticle(final NextcloudNewsArticle article);
void unstarArticle(final NewsArticle article);
}
abstract class NewsArticlesBlocStates {
BehaviorSubject<Result<List<NextcloudNewsArticle>>> get articles;
BehaviorSubject<Result<List<NewsArticle>>> get articles;
BehaviorSubject<FilterType> get filterType;
}
@ -72,7 +72,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
}
@override
BehaviorSubject<Result<List<NextcloudNewsArticle>>> articles = BehaviorSubject<Result<List<NextcloudNewsArticle>>>();
BehaviorSubject<Result<List<NewsArticle>>> articles = BehaviorSubject<Result<List<NewsArticle>>>();
@override
BehaviorSubject<FilterType> filterType = BehaviorSubject<FilterType>();
@ -125,7 +125,7 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
break;
}
await requestManager.wrapNextcloud<List<NextcloudNewsArticle>, NextcloudNewsListArticles>(
await requestManager.wrapNextcloud<List<NewsArticle>, NewsListArticles>(
client.id,
'news-articles-${type.code}-$id-$getRead',
articles,
@ -139,12 +139,12 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
}
@override
void markArticleAsRead(final NextcloudNewsArticle article) {
void markArticleAsRead(final NewsArticle article) {
wrapAction(() async => client.news.markArticleAsRead(itemId: article.id));
}
@override
void markArticleAsUnread(final NextcloudNewsArticle article) {
void markArticleAsUnread(final NewsArticle article) {
wrapAction(() async => client.news.markArticleAsUnread(itemId: article.id));
}
@ -154,12 +154,12 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
}
@override
void starArticle(final NextcloudNewsArticle article) {
void starArticle(final NewsArticle article) {
wrapAction(() async => client.news.starArticle(itemId: article.id));
}
@override
void unstarArticle(final NextcloudNewsArticle article) {
void unstarArticle(final NewsArticle article) {
wrapAction(() async => client.news.unstarArticle(itemId: article.id));
}
}

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

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

4
packages/neon/neon_news/lib/dialogs/add_feed.dart

@ -18,7 +18,7 @@ class _NewsAddFeedDialogState extends State<NewsAddFeedDialog> {
final formKey = GlobalKey<FormState>();
final controller = TextEditingController();
NextcloudNewsFolder? folder;
NewsFolder? folder;
void submit() {
if (formKey.currentState!.validate()) {
@ -43,7 +43,7 @@ class _NewsAddFeedDialogState extends State<NewsAddFeedDialog> {
}
@override
Widget build(final BuildContext context) => ResultBuilder<List<NextcloudNewsFolder>>.behaviorSubject(
Widget build(final BuildContext context) => ResultBuilder<List<NewsFolder>>.behaviorSubject(
stream: widget.bloc.folders,
builder: (final context, final folders) => NeonDialog(
title: Text(AppLocalizations.of(context).feedAdd),

2
packages/neon/neon_news/lib/dialogs/feed_show_url.dart

@ -6,7 +6,7 @@ class NewsFeedShowURLDialog extends StatefulWidget {
super.key,
});
final NextcloudNewsFeed feed;
final NewsFeed feed;
@override
State<NewsFeedShowURLDialog> createState() => _NewsFeedShowURLDialogState();

2
packages/neon/neon_news/lib/dialogs/feed_update_error.dart

@ -6,7 +6,7 @@ class NewsFeedUpdateErrorDialog extends StatefulWidget {
super.key,
});
final NextcloudNewsFeed feed;
final NewsFeed feed;
@override
State<NewsFeedUpdateErrorDialog> createState() => _NewsFeedUpdateErrorDialogState();

6
packages/neon/neon_news/lib/dialogs/move_feed.dart

@ -7,8 +7,8 @@ class NewsMoveFeedDialog extends StatefulWidget {
super.key,
});
final List<NextcloudNewsFolder> folders;
final NextcloudNewsFeed feed;
final List<NewsFolder> folders;
final NewsFeed feed;
@override
State<NewsMoveFeedDialog> createState() => _NewsMoveFeedDialogState();
@ -17,7 +17,7 @@ class NewsMoveFeedDialog extends StatefulWidget {
class _NewsMoveFeedDialogState extends State<NewsMoveFeedDialog> {
final formKey = GlobalKey<FormState>();
NextcloudNewsFolder? folder;
NewsFolder? folder;
void submit() {
if (formKey.currentState!.validate()) {

2
packages/neon/neon_news/lib/pages/feed.dart

@ -8,7 +8,7 @@ class NewsFeedPage extends StatelessWidget {
});
final NewsBloc bloc;
final NextcloudNewsFeed feed;
final NewsFeed feed;
@override
Widget build(final BuildContext context) => Scaffold(

2
packages/neon/neon_news/lib/pages/folder.dart

@ -8,7 +8,7 @@ class NewsFolderPage extends StatelessWidget {
});
final NewsBloc bloc;
final NextcloudNewsFolder folder;
final NewsFolder folder;
@override
Widget build(final BuildContext context) => Scaffold(

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

@ -1,6 +1,6 @@
part of '../neon_news.dart';
final articlesSortBox = SortBox<ArticlesSortProperty, NextcloudNewsArticle>(
final articlesSortBox = SortBox<ArticlesSortProperty, NewsArticle>(
{
ArticlesSortProperty.publishDate: (final article) => article.pubDate,
ArticlesSortProperty.alphabetical: (final article) => article.title.toLowerCase(),

2
packages/neon/neon_news/lib/sort/feeds.dart

@ -1,6 +1,6 @@
part of '../neon_news.dart';
final feedsSortBox = SortBox<FeedsSortProperty, NextcloudNewsFeed>(
final feedsSortBox = SortBox<FeedsSortProperty, NewsFeed>(
{
FeedsSortProperty.alphabetical: (final feed) => feed.title.toLowerCase(),
FeedsSortProperty.unreadCount: (final feed) => feed.unreadCount ?? 0,

2
packages/neon/neon_news/lib/sort/folders.dart

@ -11,4 +11,4 @@ final foldersSortBox = SortBox<FoldersSortProperty, FolderFeedsWrapper>(
},
);
typedef FolderFeedsWrapper = (NextcloudNewsFolder folder, int feedCount, int unreadCount);
typedef FolderFeedsWrapper = (NewsFolder folder, int feedCount, int unreadCount);

12
packages/neon/neon_news/lib/widgets/articles_view.dart

@ -25,16 +25,16 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
}
@override
Widget build(final BuildContext context) => ResultBuilder<List<NextcloudNewsFeed>>.behaviorSubject(
Widget build(final BuildContext context) => ResultBuilder<List<NewsFeed>>.behaviorSubject(
stream: widget.newsBloc.feeds,
builder: (final context, final feeds) => ResultBuilder<List<NextcloudNewsArticle>>.behaviorSubject(
builder: (final context, final feeds) => ResultBuilder<List<NewsArticle>>.behaviorSubject(
stream: widget.bloc.articles,
builder: (final context, final articles) => SortBoxBuilder<ArticlesSortProperty, NextcloudNewsArticle>(
builder: (final context, final articles) => SortBoxBuilder<ArticlesSortProperty, NewsArticle>(
sortBox: articlesSortBox,
sortPropertyOption: widget.newsBloc.options.articlesSortPropertyOption,
sortBoxOrderOption: widget.newsBloc.options.articlesSortBoxOrderOption,
input: articles.data,
builder: (final context, final sorted) => NeonListView<NextcloudNewsArticle>(
builder: (final context, final sorted) => NeonListView<NewsArticle>(
scrollKey: 'news-articles',
items: feeds.hasData ? sorted : null,
isLoading: articles.isLoading || feeds.isLoading,
@ -100,8 +100,8 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
Widget _buildArticle(
final BuildContext context,
final NextcloudNewsArticle article,
final NextcloudNewsFeed feed,
final NewsArticle article,
final NewsFeed feed,
) =>
ListTile(
title: Row(

2
packages/neon/neon_news/lib/widgets/feed_icon.dart

@ -8,7 +8,7 @@ class NewsFeedIcon extends StatelessWidget {
super.key,
});
final NextcloudNewsFeed feed;
final NewsFeed feed;
final double size;
final BorderRadius? borderRadius;

12
packages/neon/neon_news/lib/widgets/feeds_view.dart

@ -11,18 +11,18 @@ class NewsFeedsView extends StatelessWidget {
final int? folderID;
@override
Widget build(final BuildContext context) => ResultBuilder<List<NextcloudNewsFolder>>.behaviorSubject(
Widget build(final BuildContext context) => ResultBuilder<List<NewsFolder>>.behaviorSubject(
stream: bloc.folders,
builder: (final context, final folders) => ResultBuilder<List<NextcloudNewsFeed>>.behaviorSubject(
builder: (final context, final folders) => ResultBuilder<List<NewsFeed>>.behaviorSubject(
stream: bloc.feeds,
builder: (final context, final feeds) => SortBoxBuilder<FeedsSortProperty, NextcloudNewsFeed>(
builder: (final context, final feeds) => SortBoxBuilder<FeedsSortProperty, NewsFeed>(
sortBox: feedsSortBox,
sortPropertyOption: bloc.options.feedsSortPropertyOption,
sortBoxOrderOption: bloc.options.feedsSortBoxOrderOption,
input: folders.hasData
? feeds.data?.where((final f) => folderID == null || f.folderId == folderID).toList()
: null,
builder: (final context, final sorted) => NeonListView<NextcloudNewsFeed>(
builder: (final context, final sorted) => NeonListView<NewsFeed>(
scrollKey: 'news-feeds',
withFloatingActionButton: true,
items: sorted,
@ -41,8 +41,8 @@ class NewsFeedsView extends StatelessWidget {
Widget _buildFeed(
final BuildContext context,
final NextcloudNewsFeed feed,
final List<NextcloudNewsFolder> folders,
final NewsFeed feed,
final List<NewsFolder> folders,
) =>
ListTile(
title: Text(

10
packages/neon/neon_news/lib/widgets/folder_select.dart

@ -8,12 +8,12 @@ class NewsFolderSelect extends StatelessWidget {
super.key,
});
final List<NextcloudNewsFolder> folders;
final void Function(NextcloudNewsFolder?) onChanged;
final NextcloudNewsFolder? value;
final List<NewsFolder> folders;
final void Function(NewsFolder?) onChanged;
final NewsFolder? value;
@override
Widget build(final BuildContext context) => DropdownButtonFormField<NextcloudNewsFolder>(
Widget build(final BuildContext context) => DropdownButtonFormField<NewsFolder>(
decoration: InputDecoration(
hintText: AppLocalizations.of(context).folder,
),
@ -23,7 +23,7 @@ class NewsFolderSelect extends StatelessWidget {
child: Text(AppLocalizations.of(context).folderRoot),
),
...folders.map(
(final f) => DropdownMenuItem<NextcloudNewsFolder>(
(final f) => DropdownMenuItem<NewsFolder>(
value: f,
child: Text(f.name),
),

2
packages/neon/neon_news/lib/widgets/folder_view.dart

@ -8,7 +8,7 @@ class NewsFolderView extends StatefulWidget {
});
final NewsBloc bloc;
final NextcloudNewsFolder folder;
final NewsFolder folder;
@override
State<NewsFolderView> createState() => _NewsFolderViewState();

4
packages/neon/neon_news/lib/widgets/folders_view.dart

@ -9,9 +9,9 @@ class NewsFoldersView extends StatelessWidget {
final NewsBloc bloc;
@override
Widget build(final BuildContext context) => ResultBuilder<List<NextcloudNewsFolder>>.behaviorSubject(
Widget build(final BuildContext context) => ResultBuilder<List<NewsFolder>>.behaviorSubject(
stream: bloc.folders,
builder: (final context, final folders) => ResultBuilder<List<NextcloudNewsFeed>>.behaviorSubject(
builder: (final context, final folders) => ResultBuilder<List<NewsFeed>>.behaviorSubject(
stream: bloc.feeds,
builder: (final context, final feeds) => SortBoxBuilder<FoldersSortProperty, FolderFeedsWrapper>(
sortBox: foldersSortBox,

6
packages/neon/neon_notes/lib/blocs/note.dart

@ -17,7 +17,7 @@ class NotesNoteBloc extends InteractiveBloc implements NotesNoteBlocEvents, Note
this.options,
this._client,
this._notesBloc,
final NextcloudNotesNote note,
final NotesNote note,
) {
_emitNote(note);
id = note.id;
@ -25,13 +25,13 @@ class NotesNoteBloc extends InteractiveBloc implements NotesNoteBlocEvents, Note
initialTitle = note.title;
}
void _emitNote(final NextcloudNotesNote note) {
void _emitNote(final NotesNote note) {
category.add(note.category);
_etag = note.etag;
}
// ignore: avoid_void_async
void _wrapAction(final Future<NextcloudNotesNote> Function(String etag) call) async {
void _wrapAction(final Future<NotesNote> Function(String etag) call) async {
await _updateQueue.add(() async {
try {
final data = await call(_etag);

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

@ -19,7 +19,7 @@ abstract class NotesBlocEvents {
}
abstract class NotesBlocStates {
BehaviorSubject<Result<List<NextcloudNotesNote>>> get notes;
BehaviorSubject<Result<List<NotesNote>>> get notes;
}
class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocStates {
@ -42,16 +42,16 @@ class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocSta
}
@override
BehaviorSubject<Result<List<NextcloudNotesNote>>> notes = BehaviorSubject<Result<List<NextcloudNotesNote>>>();
BehaviorSubject<Result<List<NotesNote>>> notes = BehaviorSubject<Result<List<NotesNote>>>();
@override
Future refresh() async {
await requestManager.wrapNextcloud<List<NextcloudNotesNote>, BuiltList>(
await requestManager.wrapNextcloud<List<NotesNote>, BuiltList>(
client.id,
'notes-notes',
notes,
() async => client.notes.getNotes(),
List<NextcloudNotesNote>.from,
List<NotesNote>.from,
);
}

2
packages/neon/neon_notes/lib/dialogs/create_note.dart

@ -26,7 +26,7 @@ class _NotesCreateNoteDialogState extends State<NotesCreateNoteDialog> {
}
@override
Widget build(final BuildContext context) => ResultBuilder<List<NextcloudNotesNote>>.behaviorSubject(
Widget build(final BuildContext context) => ResultBuilder<List<NotesNote>>.behaviorSubject(
stream: widget.bloc.notes,
builder: (final context, final notes) => NeonDialog(
title: Text(AppLocalizations.of(context).noteCreate),

2
packages/neon/neon_notes/lib/dialogs/select_category.dart

@ -26,7 +26,7 @@ class _NotesSelectCategoryDialogState extends State<NotesSelectCategoryDialog> {
}
@override
Widget build(final BuildContext context) => ResultBuilder<List<NextcloudNotesNote>>.behaviorSubject(
Widget build(final BuildContext context) => ResultBuilder<List<NotesNote>>.behaviorSubject(
stream: widget.bloc.notes,
builder: (final context, final notes) => NeonDialog(
title: Text(AppLocalizations.of(context).category),

2
packages/neon/neon_notes/lib/sort/notes.dart

@ -1,6 +1,6 @@
part of '../neon_notes.dart';
final notesSortBox = SortBox<NotesSortProperty, NextcloudNotesNote>(
final notesSortBox = SortBox<NotesSortProperty, NotesNote>(
{
NotesSortProperty.alphabetical: (final note) => note.title.toLowerCase(),
NotesSortProperty.lastModified: (final note) => note.modified,

2
packages/neon/neon_notes/lib/widgets/categories_view.dart

@ -9,7 +9,7 @@ class NotesCategoriesView extends StatelessWidget {
final NotesBloc bloc;
@override
Widget build(final BuildContext context) => ResultBuilder<List<NextcloudNotesNote>>.behaviorSubject(
Widget build(final BuildContext context) => ResultBuilder<List<NotesNote>>.behaviorSubject(
stream: bloc.notes,
builder: (final context, final notes) => SortBoxBuilder<CategoriesSortProperty, NoteCategory>(
sortBox: categoriesSortBox,

10
packages/neon/neon_notes/lib/widgets/notes_view.dart

@ -11,23 +11,23 @@ class NotesView extends StatelessWidget {
final String? category;
@override
Widget build(final BuildContext context) => ResultBuilder<List<NextcloudNotesNote>>.behaviorSubject(
Widget build(final BuildContext context) => ResultBuilder<List<NotesNote>>.behaviorSubject(
stream: bloc.notes,
builder: (final context, final notes) => SortBoxBuilder<NotesSortProperty, NextcloudNotesNote>(
builder: (final context, final notes) => SortBoxBuilder<NotesSortProperty, NotesNote>(
sortBox: notesSortBox,
sortPropertyOption: bloc.options.notesSortPropertyOption,
sortBoxOrderOption: bloc.options.notesSortBoxOrderOption,
input: category != null
? notes.data?.where((final note) => note.favorite && note.category == category).toList()
: notes.data?.where((final note) => note.favorite).toList(),
builder: (final context, final sortedFavorites) => SortBoxBuilder<NotesSortProperty, NextcloudNotesNote>(
builder: (final context, final sortedFavorites) => SortBoxBuilder<NotesSortProperty, NotesNote>(
sortBox: notesSortBox,
sortPropertyOption: bloc.options.notesSortPropertyOption,
sortBoxOrderOption: bloc.options.notesSortBoxOrderOption,
input: category != null
? notes.data?.where((final note) => !note.favorite && note.category == category).toList()
: notes.data?.where((final note) => !note.favorite).toList(),
builder: (final context, final sortedNonFavorites) => NeonListView<NextcloudNotesNote>(
builder: (final context, final sortedNonFavorites) => NeonListView<NotesNote>(
scrollKey: 'notes-notes',
withFloatingActionButton: true,
items: [
@ -45,7 +45,7 @@ class NotesView extends StatelessWidget {
Widget _buildNote(
final BuildContext context,
final NextcloudNotesNote note,
final NotesNote note,
) =>
ListTile(
title: Text(note.title),

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

@ -7,7 +7,7 @@ abstract interface class NotificationsBlocEvents {
}
abstract interface class NotificationsBlocStates {
BehaviorSubject<Result<List<NextcloudNotificationsNotification>>> get notifications;
BehaviorSubject<Result<List<NotificationsNotification>>> get notifications;
BehaviorSubject<int> get unreadCounter;
}
@ -41,16 +41,15 @@ class NotificationsBloc extends InteractiveBloc
}
@override
BehaviorSubject<Result<List<NextcloudNotificationsNotification>>> notifications =
BehaviorSubject<Result<List<NextcloudNotificationsNotification>>>();
BehaviorSubject<Result<List<NotificationsNotification>>> notifications =
BehaviorSubject<Result<List<NotificationsNotification>>>();
@override
BehaviorSubject<int> unreadCounter = BehaviorSubject<int>();
@override
Future refresh() async {
await _requestManager
.wrapNextcloud<List<NextcloudNotificationsNotification>, NextcloudNotificationsListNotifications>(
await _requestManager.wrapNextcloud<List<NotificationsNotification>, NotificationsListNotifications>(
_client.id,
'notifications-notifications',
notifications,

6
packages/neon/neon_notifications/lib/pages/main.dart

@ -24,7 +24,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
}
@override
Widget build(final BuildContext context) => ResultBuilder<List<NextcloudNotificationsNotification>>.behaviorSubject(
Widget build(final BuildContext context) => ResultBuilder<List<NotificationsNotification>>.behaviorSubject(
stream: bloc.notifications,
builder: (final context, final notifications) => Scaffold(
resizeToAvoidBottomInset: false,
@ -35,7 +35,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
tooltip: AppLocalizations.of(context).notificationsDismissAll,
child: Icon(MdiIcons.checkAll),
),
body: NeonListView<NextcloudNotificationsNotification>(
body: NeonListView<NotificationsNotification>(
scrollKey: 'notifications-notifications',
withFloatingActionButton: true,
items: notifications.data,
@ -49,7 +49,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
Widget _buildNotification(
final BuildContext context,
final NextcloudNotificationsNotification notification,
final NotificationsNotification notification,
) {
final app = Provider.of<Iterable<AppImplementation>>(context, listen: false).tryFind(notification.app);

Loading…
Cancel
Save