Browse Source

Merge pull request #436 from provokateurin/refactor/libraries

Refactor/libraries
pull/448/head
Kate 2 years ago committed by GitHub
parent
commit
bff22dca6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/app/integration_test/screenshot_test.dart
  2. 4
      packages/app/lib/apps.dart
  3. 2
      packages/app/lib/branding.dart
  4. 11
      packages/app/pubspec.lock
  5. 4
      packages/app/pubspec_overrides.yaml
  6. 5
      packages/neon/neon/lib/blocs.dart
  7. 4
      packages/neon/neon/lib/models.dart
  8. 106
      packages/neon/neon/lib/neon.dart
  9. 1
      packages/neon/neon/lib/platform.dart
  10. 6
      packages/neon/neon/lib/settings.dart
  11. 3
      packages/neon/neon/lib/sort_box.dart
  12. 27
      packages/neon/neon/lib/src/app.dart
  13. 5
      packages/neon/neon/lib/src/bloc/bloc.dart
  14. 2
      packages/neon/neon/lib/src/bloc/result.dart
  15. 4
      packages/neon/neon/lib/src/bloc/result_builder.dart
  16. 19
      packages/neon/neon/lib/src/blocs/accounts.dart
  17. 20
      packages/neon/neon/lib/src/blocs/apps.dart
  18. 23
      packages/neon/neon/lib/src/blocs/blocs.dart
  19. 11
      packages/neon/neon/lib/src/blocs/capabilities.dart
  20. 8
      packages/neon/neon/lib/src/blocs/first_launch.dart
  21. 11
      packages/neon/neon/lib/src/blocs/login.dart
  22. 11
      packages/neon/neon/lib/src/blocs/next_push.dart
  23. 18
      packages/neon/neon/lib/src/blocs/push_notifications.dart
  24. 6
      packages/neon/neon/lib/src/blocs/timer.dart
  25. 11
      packages/neon/neon/lib/src/blocs/user_details.dart
  26. 14
      packages/neon/neon/lib/src/blocs/user_statuses.dart
  27. 21
      packages/neon/neon/lib/src/models/app_implementation.dart
  28. 2
      packages/neon/neon/lib/src/models/branding.dart
  29. 6
      packages/neon/neon/lib/src/models/notifications_interface.dart
  30. 3
      packages/neon/neon/lib/src/models/push_notification.dart
  31. 17
      packages/neon/neon/lib/src/pages/account_settings.dart
  32. 23
      packages/neon/neon/lib/src/pages/home.dart
  33. 19
      packages/neon/neon/lib/src/pages/login.dart
  34. 12
      packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart
  35. 33
      packages/neon/neon/lib/src/pages/settings.dart
  36. 36
      packages/neon/neon/lib/src/platform/abstract.dart
  37. 8
      packages/neon/neon/lib/src/platform/android.dart
  38. 9
      packages/neon/neon/lib/src/platform/linux.dart
  39. 40
      packages/neon/neon/lib/src/platform/platform.dart
  40. 10
      packages/neon/neon/lib/src/router.dart
  41. 8
      packages/neon/neon/lib/src/settings/models/nextcloud_app_options.dart
  42. 10
      packages/neon/neon/lib/src/settings/models/option.dart
  43. 2
      packages/neon/neon/lib/src/settings/models/options_category.dart
  44. 6
      packages/neon/neon/lib/src/settings/models/select_option.dart
  45. 13
      packages/neon/neon/lib/src/settings/models/storage.dart
  46. 3
      packages/neon/neon/lib/src/settings/models/toggle_option.dart
  47. 11
      packages/neon/neon/lib/src/settings/widgets/account_settings_tile.dart
  48. 7
      packages/neon/neon/lib/src/settings/widgets/checkbox_settings_tile.dart
  49. 5
      packages/neon/neon/lib/src/settings/widgets/custom_settings_tile.dart
  50. 8
      packages/neon/neon/lib/src/settings/widgets/dropdown_button_settings_tile.dart
  51. 5
      packages/neon/neon/lib/src/settings/widgets/label_builder.dart
  52. 3
      packages/neon/neon/lib/src/settings/widgets/option_builder.dart
  53. 6
      packages/neon/neon/lib/src/settings/widgets/settings_category.dart
  54. 6
      packages/neon/neon/lib/src/settings/widgets/settings_list.dart
  55. 6
      packages/neon/neon/lib/src/settings/widgets/settings_tile.dart
  56. 9
      packages/neon/neon/lib/src/settings/widgets/text_settings_tile.dart
  57. 5
      packages/neon/neon/lib/src/sort_box/sort_box_builder.dart
  58. 4
      packages/neon/neon/lib/src/sort_box/sort_box_order_option_values.dart
  59. 12
      packages/neon/neon/lib/src/utils/account_options.dart
  60. 3
      packages/neon/neon/lib/src/utils/confirmation_dialog.dart
  61. 2
      packages/neon/neon/lib/src/utils/exceptions.dart
  62. 4
      packages/neon/neon/lib/src/utils/global.dart
  63. 18
      packages/neon/neon/lib/src/utils/global_options.dart
  64. 11
      packages/neon/neon/lib/src/utils/global_popups.dart
  65. 2
      packages/neon/neon/lib/src/utils/hex_color.dart
  66. 7
      packages/neon/neon/lib/src/utils/localizations.dart
  67. 26
      packages/neon/neon/lib/src/utils/push_utils.dart
  68. 4
      packages/neon/neon/lib/src/utils/rename_dialog.dart
  69. 11
      packages/neon/neon/lib/src/utils/request_manager.dart
  70. 6
      packages/neon/neon/lib/src/utils/save_file.dart
  71. 7
      packages/neon/neon/lib/src/utils/settings_export_helper.dart
  72. 5
      packages/neon/neon/lib/src/utils/stream_listenable.dart
  73. 7
      packages/neon/neon/lib/src/utils/theme.dart
  74. 3
      packages/neon/neon/lib/src/utils/validators.dart
  75. 12
      packages/neon/neon/lib/src/widgets/account_tile.dart
  76. 11
      packages/neon/neon/lib/src/widgets/app_bar.dart
  77. 6
      packages/neon/neon/lib/src/widgets/app_implementation_icon.dart
  78. 10
      packages/neon/neon/lib/src/widgets/cached_image.dart
  79. 2
      packages/neon/neon/lib/src/widgets/dialog.dart
  80. 11
      packages/neon/neon/lib/src/widgets/drawer.dart
  81. 9
      packages/neon/neon/lib/src/widgets/drawer_destination.dart
  82. 12
      packages/neon/neon/lib/src/widgets/exception.dart
  83. 2
      packages/neon/neon/lib/src/widgets/image_wrapper.dart
  84. 2
      packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart
  85. 4
      packages/neon/neon/lib/src/widgets/list_view.dart
  86. 3
      packages/neon/neon/lib/src/widgets/nextcloud_logo.dart
  87. 2
      packages/neon/neon/lib/src/widgets/relative_time.dart
  88. 12
      packages/neon/neon/lib/src/widgets/user_avatar.dart
  89. 6
      packages/neon/neon/lib/utils.dart
  90. 7
      packages/neon/neon/lib/widgets.dart
  91. 5
      packages/neon/neon/pubspec.yaml
  92. 4
      packages/neon/neon/pubspec_overrides.yaml
  93. 2
      packages/neon/neon/test/hex_color_test.dart
  94. 2
      packages/neon/neon/test/result_test.dart
  95. 2
      packages/neon/neon/test/timer_bloc_test.dart
  96. 10
      packages/neon/neon_files/lib/neon_files.dart
  97. 2
      packages/neon/neon_files/lib/options.dart
  98. 8
      packages/neon/neon_files/pubspec.yaml
  99. 4
      packages/neon/neon_files/pubspec_overrides.yaml
  100. 10
      packages/neon/neon_news/lib/blocs/article.dart
  101. Some files were not shown because too many files have changed in this diff Show More

1
packages/app/integration_test/screenshot_test.dart

@ -7,6 +7,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:neon/models.dart';
import 'package:neon/neon.dart';
import 'package:neon_files/neon_files.dart';
import 'package:shared_preferences/shared_preferences.dart';

4
packages/app/lib/apps.dart

@ -1,4 +1,6 @@
import 'package:neon/neon.dart';
import 'package:neon/models.dart';
import 'package:neon/platform.dart';
import 'package:neon/utils.dart';
import 'package:neon_files/neon_files.dart';
import 'package:neon_news/neon_news.dart';
import 'package:neon_notes/neon_notes.dart';

2
packages/app/lib/branding.dart

@ -1,5 +1,5 @@
import 'package:flutter_svg/flutter_svg.dart';
import 'package:neon/neon.dart';
import 'package:neon/models.dart';
Branding getNeonBranding() => Branding(
name: 'Nextcloud Neon',

11
packages/app/pubspec.lock

@ -101,10 +101,10 @@ packages:
dependency: transitive
description:
name: cookie_jar
sha256: "823fd13d22c5cf0c846e8a31c9b276f768f423cca134990c22c33045462f8ef9"
sha256: "1024f3a52bee181fc8f10f4a359085471587d7406323090a53a7171bc0aa5c37"
url: "https://pub.dev"
source: hosted
version: "4.0.3"
version: "4.0.5"
cross_file:
dependency: transitive
description:
@ -861,13 +861,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.1.6"
settings:
dependency: "direct overridden"
description:
path: "../settings"
relative: true
source: path
version: "1.0.0"
share_plus:
dependency: transitive
description:

4
packages/app/pubspec_overrides.yaml

@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: dynamite_runtime,file_icons,neon,neon_files,neon_news,neon_notes,neon_notifications,nextcloud,settings,sort_box,wakelock_windows
# melos_managed_dependency_overrides: dynamite_runtime,file_icons,neon,neon_files,neon_news,neon_notes,neon_notifications,nextcloud,sort_box,wakelock_windows
dependency_overrides:
dynamite_runtime:
path: ../dynamite/dynamite_runtime
@ -16,8 +16,6 @@ dependency_overrides:
path: ../neon/neon_notifications
nextcloud:
path: ../nextcloud
settings:
path: ../settings
sort_box:
path: ../sort_box
wakelock_windows:

5
packages/neon/neon/lib/blocs.dart

@ -0,0 +1,5 @@
export 'package:neon/src/bloc/bloc.dart';
export 'package:neon/src/bloc/result.dart';
export 'package:neon/src/bloc/result_builder.dart';
export 'package:neon/src/blocs/accounts.dart'; // TODO: Remove access to the AccountsBloc. Apps should not need to access this
export 'package:neon/src/blocs/timer.dart';

4
packages/neon/neon/lib/models.dart

@ -0,0 +1,4 @@
export 'package:neon/src/models/account.dart';
export 'package:neon/src/models/app_implementation.dart';
export 'package:neon/src/models/branding.dart';
export 'package:neon/src/models/notifications_interface.dart';

106
packages/neon/neon/lib/neon.dart

@ -1,107 +1,21 @@
library neon;
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:ui';
import 'package:bitmap/bitmap.dart';
import 'package:collection/collection.dart';
import 'package:crypto/crypto.dart';
import 'package:file_picker/file_picker.dart';
import 'package:filesize/filesize.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter_file_dialog/flutter_file_dialog.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:http/http.dart';
import 'package:intl/intl_standalone.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/blocs.dart';
import 'package:neon/src/app.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/blocs/first_launch.dart';
import 'package:neon/src/blocs/next_push.dart';
import 'package:neon/src/blocs/push_notifications.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/push_notification.dart';
import 'package:neon/src/router.dart';
import 'package:neon/src/widgets/app_bar.dart';
import 'package:neon/src/widgets/drawer.dart';
import 'package:neon/src/widgets/drawer_destination.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/models/branding.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:neon/src/utils/request_manager.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:quick_actions/quick_actions.dart';
import 'package:rxdart/rxdart.dart';
import 'package:settings/settings.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:sort_box/sort_box.dart';
import 'package:sqflite/sqflite.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
import 'package:tray_manager/tray_manager.dart' as tray;
import 'package:url_launcher/url_launcher_string.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:window_manager/window_manager.dart';
import 'package:xdg_directories/xdg_directories.dart' as xdg;
import 'package:xml/xml.dart' as xml;
export 'src/blocs/blocs.dart';
export 'src/models/account.dart';
export 'src/models/push_notification.dart';
part 'src/app.dart';
part 'src/interfaces/notifications.dart';
part 'src/pages/account_settings.dart';
part 'src/pages/home.dart';
part 'src/pages/login.dart';
part 'src/pages/nextcloud_app_settings.dart';
part 'src/pages/settings.dart';
part 'src/platform/abstract.dart';
part 'src/platform/android.dart';
part 'src/platform/linux.dart';
part 'src/platform/platform.dart';
part 'src/utils/account_options.dart';
part 'src/utils/app_implementation.dart';
part 'src/utils/bloc.dart';
part 'src/utils/branding.dart';
part 'src/utils/confirmation_dialog.dart';
part 'src/utils/exceptions.dart';
part 'src/utils/global.dart';
part 'src/utils/global_options.dart';
part 'src/utils/global_popups.dart';
part 'src/utils/hex_color.dart';
part 'src/utils/localizations.dart';
part 'src/utils/nextcloud_app_specific_options.dart';
part 'src/utils/push_utils.dart';
part 'src/utils/rename_dialog.dart';
part 'src/utils/request_manager.dart';
part 'src/utils/result.dart';
part 'src/utils/save_file.dart';
part 'src/utils/settings_export_helper.dart';
part 'src/utils/sort_box_builder.dart';
part 'src/utils/sort_box_order_option_values.dart';
part 'src/utils/storage.dart';
part 'src/utils/stream_listenable.dart';
part 'src/utils/theme.dart';
part 'src/utils/validators.dart';
part 'src/widgets/account_settings_tile.dart';
part 'src/widgets/account_tile.dart';
part 'src/widgets/app_implementation_icon.dart';
part 'src/widgets/cached_image.dart';
part 'src/widgets/dialog.dart';
part 'src/widgets/exception.dart';
part 'src/widgets/image_wrapper.dart';
part 'src/widgets/linear_progress_indicator.dart';
part 'src/widgets/list_view.dart';
part 'src/widgets/nextcloud_logo.dart';
part 'src/widgets/relative_time.dart';
part 'src/widgets/result_builder.dart';
part 'src/widgets/text_settings_tile.dart';
part 'src/widgets/user_avatar.dart';
Future runNeon({
required final Iterable<AppImplementation> Function(SharedPreferences, RequestManager, NeonPlatform)

1
packages/neon/neon/lib/platform.dart

@ -0,0 +1 @@
export 'package:neon/src/platform/platform.dart';

6
packages/neon/neon/lib/settings.dart

@ -0,0 +1,6 @@
export 'package:neon/src/settings/models/nextcloud_app_options.dart';
export 'package:neon/src/settings/models/options_category.dart';
export 'package:neon/src/settings/models/select_option.dart';
export 'package:neon/src/settings/models/storage.dart';
export 'package:neon/src/settings/models/toggle_option.dart';
export 'package:neon/src/settings/widgets/option_builder.dart';

3
packages/neon/neon/lib/sort_box.dart

@ -0,0 +1,3 @@
export 'package:neon/src/sort_box/sort_box_builder.dart';
export 'package:neon/src/sort_box/sort_box_order_option_values.dart';
export 'package:sort_box/sort_box.dart';

27
packages/neon/neon/lib/src/app.dart

@ -1,4 +1,29 @@
part of '../../neon.dart';
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/bloc/result_builder.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/blocs/capabilities.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/models/notifications_interface.dart';
import 'package:neon/src/models/push_notification.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/router.dart';
import 'package:neon/src/settings/widgets/option_builder.dart';
import 'package:neon/src/utils/global.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:neon/src/utils/localizations.dart';
import 'package:neon/src/utils/push_utils.dart';
import 'package:neon/src/utils/theme.dart';
import 'package:provider/provider.dart';
import 'package:quick_actions/quick_actions.dart';
import 'package:tray_manager/tray_manager.dart' as tray;
import 'package:window_manager/window_manager.dart';
class NeonApp extends StatefulWidget {
const NeonApp({

5
packages/neon/neon/lib/src/utils/bloc.dart → packages/neon/neon/lib/src/bloc/bloc.dart

@ -1,4 +1,7 @@
part of '../../neon.dart';
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:neon/src/utils/request_manager.dart';
abstract class Bloc {
void dispose();

2
packages/neon/neon/lib/src/utils/result.dart → packages/neon/neon/lib/src/bloc/result.dart

@ -1,4 +1,4 @@
part of '../../neon.dart';
import 'package:meta/meta.dart';
@immutable
class Result<T> {

4
packages/neon/neon/lib/src/widgets/result_builder.dart → packages/neon/neon/lib/src/bloc/result_builder.dart

@ -1,4 +1,6 @@
part of '../../neon.dart';
import 'package:flutter/widgets.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:rxdart/rxdart.dart';
typedef ResultWidgetBuilder<T> = Widget Function(BuildContext context, Result<T> snapshot);

19
packages/neon/neon/lib/src/blocs/accounts.dart

@ -1,4 +1,21 @@
part of 'blocs.dart';
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/blocs/apps.dart';
import 'package:neon/src/blocs/capabilities.dart';
import 'package:neon/src/blocs/user_details.dart';
import 'package:neon/src/blocs/user_statuses.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/utils/account_options.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:neon/src/utils/request_manager.dart';
import 'package:rxdart/rxdart.dart';
import 'package:shared_preferences/shared_preferences.dart';
const _keyAccounts = 'accounts';

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

@ -1,4 +1,19 @@
part of 'blocs.dart';
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/blocs/capabilities.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/models/notifications_interface.dart';
import 'package:neon/src/settings/models/nextcloud_app_options.dart';
import 'package:neon/src/utils/request_manager.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
typedef NextcloudApp = CoreNavigationApps_Ocs_Data;
@ -20,6 +35,7 @@ abstract class AppsBlocStates {
BehaviorSubject<Iterable<(String, Object?)>?> get appVersions;
}
@internal
class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates {
AppsBloc(
this._requestManager,
@ -147,7 +163,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
BehaviorSubject<AppImplementation> activeApp = BehaviorSubject<AppImplementation>();
@override
BehaviorSubject<Result<Iterable<AppImplementation<Bloc, NextcloudAppSpecificOptions>>>> appImplementations =
BehaviorSubject<Result<Iterable<AppImplementation<Bloc, NextcloudAppOptions>>>> appImplementations =
BehaviorSubject<Result<Iterable<AppImplementation>>>();
@override

23
packages/neon/neon/lib/src/blocs/blocs.dart

@ -1,23 +0,0 @@
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:neon/neon.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:unifiedpush/unifiedpush.dart';
import 'package:window_manager/window_manager.dart';
part 'accounts.dart';
part 'apps.dart';
part 'capabilities.dart';
part 'first_launch.dart';
part 'login.dart';
part 'next_push.dart';
part 'push_notifications.dart';
part 'user_details.dart';
part 'timer.dart';
part 'user_statuses.dart';

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

@ -1,4 +1,12 @@
part of 'blocs.dart';
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/utils/request_manager.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:rxdart/rxdart.dart';
typedef Capabilities = CoreServerCapabilities_Ocs_Data;
typedef NextcloudTheme = CoreServerCapabilities_Ocs_Data_Capabilities_Theming;
@ -9,6 +17,7 @@ abstract class CapabilitiesBlocStates {
BehaviorSubject<Result<Capabilities>> get capabilities;
}
@internal
class CapabilitiesBloc extends InteractiveBloc implements CapabilitiesBlocEvents, CapabilitiesBlocStates {
CapabilitiesBloc(
this._requestManager,

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

@ -1,4 +1,9 @@
part of 'blocs.dart';
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:rxdart/rxdart.dart';
import 'package:shared_preferences/shared_preferences.dart';
abstract class FirstLaunchBlocEvents {}
@ -6,6 +11,7 @@ abstract class FirstLaunchBlocStates {
BehaviorSubject get onFirstLaunch;
}
@internal
class FirstLaunchBloc extends Bloc implements FirstLaunchBlocEvents, FirstLaunchBlocStates {
FirstLaunchBloc(
this._sharedPreferences, {

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

@ -1,4 +1,12 @@
part of 'blocs.dart';
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/models/account.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:rxdart/rxdart.dart';
abstract class LoginBlocEvents {
void setServerURL(final String? url);
@ -14,6 +22,7 @@ abstract class LoginBlocStates {
BehaviorSubject<CoreLoginFlowResult?> get loginFlowResult;
}
@internal
class LoginBloc extends InteractiveBloc implements LoginBlocEvents, LoginBlocStates {
LoginBloc(this._packageInfo);

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

@ -1,4 +1,12 @@
part of 'blocs.dart';
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:rxdart/rxdart.dart';
abstract class NextPushBlocEvents {}
@ -6,6 +14,7 @@ abstract class NextPushBlocStates {
BehaviorSubject get onNextPushSupported;
}
@internal
class NextPushBloc extends Bloc implements NextPushBlocEvents, NextPushBlocStates {
NextPushBloc(
this._accountsBloc,

18
packages/neon/neon/lib/src/blocs/push_notifications.dart

@ -1,4 +1,19 @@
part of 'blocs.dart';
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/push_notification.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:neon/src/utils/push_utils.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:unifiedpush/unifiedpush.dart';
abstract class PushNotificationsBlocEvents {}
@ -6,6 +21,7 @@ abstract class PushNotificationsBlocStates {
Stream<PushNotification> get notifications;
}
@internal
class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents, PushNotificationsBlocStates {
PushNotificationsBloc(
this._accountsBloc,

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

@ -1,4 +1,8 @@
part of 'blocs.dart';
import 'dart:async';
import 'dart:ui';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
abstract class TimerBlocEvents {
/// Register a [callback] that will be called periodically.

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

@ -1,4 +1,12 @@
part of 'blocs.dart';
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/utils/request_manager.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:rxdart/rxdart.dart';
abstract class UserDetailsBlocEvents {}
@ -6,6 +14,7 @@ abstract class UserDetailsBlocStates {
BehaviorSubject<Result<ProvisioningApiUserDetails>> get userDetails;
}
@internal
class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents, UserDetailsBlocStates {
UserDetailsBloc(
this._requestManager,

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

@ -1,4 +1,15 @@
part of 'blocs.dart';
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/blocs/timer.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:rxdart/rxdart.dart';
import 'package:window_manager/window_manager.dart';
abstract class UserStatusesBlocEvents {
void load(final String username, {final bool force = false});
@ -8,6 +19,7 @@ abstract class UserStatusesBlocStates {
BehaviorSubject<Map<String, Result<UserStatusPublicStatus?>>> get statuses;
}
@internal
class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents, UserStatusesBlocStates {
UserStatusesBloc(
this._platform,

21
packages/neon/neon/lib/src/utils/app_implementation.dart → packages/neon/neon/lib/src/models/app_implementation.dart

@ -1,6 +1,21 @@
part of '../../neon.dart';
abstract class AppImplementation<T extends Bloc, R extends NextcloudAppSpecificOptions> {
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/settings/models/nextcloud_app_options.dart';
import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/utils/request_manager.dart';
import 'package:neon/src/widgets/drawer_destination.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
import 'package:shared_preferences/shared_preferences.dart';
abstract class AppImplementation<T extends Bloc, R extends NextcloudAppOptions> {
AppImplementation(
final SharedPreferences sharedPreferences,
this.requestManager,

2
packages/neon/neon/lib/src/utils/branding.dart → packages/neon/neon/lib/src/models/branding.dart

@ -1,4 +1,4 @@
part of '../../neon.dart';
import 'package:flutter/widgets.dart';
@immutable
class Branding {

6
packages/neon/neon/lib/src/interfaces/notifications.dart → packages/neon/neon/lib/src/models/notifications_interface.dart

@ -1,4 +1,6 @@
part of '../../neon.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/settings/models/nextcloud_app_options.dart';
abstract interface class NotificationsAppInterface<T extends NotificationsBlocInterface,
R extends NotificationsOptionsInterface> extends AppImplementation<T, R> {
@ -16,6 +18,6 @@ abstract interface class NotificationsBlocInterface extends InteractiveBloc {
void deleteNotification(final int id);
}
abstract interface class NotificationsOptionsInterface extends NextcloudAppSpecificOptions {
abstract interface class NotificationsOptionsInterface extends NextcloudAppOptions {
NotificationsOptionsInterface(super.storage);
}

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

@ -1,11 +1,12 @@
import 'package:flutter/foundation.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';
import 'package:nextcloud/nextcloud.dart';
part 'push_notification.g.dart';
@JsonSerializable()
@immutable
@internal
class PushNotification {
const PushNotification({
required this.accountID,

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

@ -1,4 +1,19 @@
part of '../../neon.dart';
import 'package:filesize/filesize.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/bloc/result_builder.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/router.dart';
import 'package:neon/src/settings/widgets/custom_settings_tile.dart';
import 'package:neon/src/settings/widgets/dropdown_button_settings_tile.dart';
import 'package:neon/src/settings/widgets/settings_category.dart';
import 'package:neon/src/settings/widgets/settings_list.dart';
import 'package:neon/src/utils/confirmation_dialog.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:neon/src/widgets/linear_progress_indicator.dart';
import 'package:nextcloud/nextcloud.dart';
class AccountSettingsPage extends StatelessWidget {
AccountSettingsPage({

23
packages/neon/neon/lib/src/pages/home.dart

@ -1,4 +1,21 @@
part of '../../neon.dart';
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/bloc/result_builder.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/blocs/apps.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/settings/widgets/option_builder.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:neon/src/utils/global_options.dart' as global_options;
import 'package:neon/src/utils/global_popups.dart';
import 'package:neon/src/widgets/app_bar.dart';
import 'package:neon/src/widgets/drawer.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:neon/src/widgets/user_avatar.dart';
import 'package:provider/provider.dart';
const kQuickBarWidth = kAvatarSize + 20;
@ -133,10 +150,10 @@ class _HomePageState extends State<HomePage> {
},
);
final body = OptionBuilder<NavigationMode>(
final body = OptionBuilder<global_options.NavigationMode>(
option: _globalOptions.navigationMode,
builder: (final context, final navigationMode) {
final drawerAlwaysVisible = navigationMode == NavigationMode.drawerAlwaysVisible;
final drawerAlwaysVisible = navigationMode == global_options.NavigationMode.drawerAlwaysVisible;
final body = Scaffold(
key: _scaffoldKey,

19
packages/neon/neon/lib/src/pages/login.dart

@ -1,4 +1,19 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/blocs/login.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/branding.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/router.dart';
import 'package:neon/src/utils/validators.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:neon/src/widgets/linear_progress_indicator.dart';
import 'package:neon/src/widgets/nextcloud_logo.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:webview_flutter/webview_flutter.dart';
class LoginPage extends StatefulWidget {
const LoginPage({
@ -13,7 +28,7 @@ class LoginPage extends StatefulWidget {
}
class _LoginPageState extends State<LoginPage> {
WebViewController? _webViewController;
late WebViewController? _webViewController;
final _formKey = GlobalKey<FormState>();
final _focusNode = FocusNode();
late final PackageInfo _packageInfo;

12
packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart

@ -1,4 +1,14 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/settings/models/select_option.dart';
import 'package:neon/src/settings/models/toggle_option.dart';
import 'package:neon/src/settings/widgets/checkbox_settings_tile.dart';
import 'package:neon/src/settings/widgets/dropdown_button_settings_tile.dart';
import 'package:neon/src/settings/widgets/settings_category.dart';
import 'package:neon/src/settings/widgets/settings_list.dart';
import 'package:neon/src/utils/confirmation_dialog.dart';
class NextcloudAppSettingsPage extends StatelessWidget {
const NextcloudAppSettingsPage({

33
packages/neon/neon/lib/src/pages/settings.dart

@ -1,4 +1,31 @@
part of '../../neon.dart';
import 'dart:convert';
import 'dart:typed_data';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/models/branding.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/router.dart';
import 'package:neon/src/settings/widgets/account_settings_tile.dart';
import 'package:neon/src/settings/widgets/checkbox_settings_tile.dart';
import 'package:neon/src/settings/widgets/custom_settings_tile.dart';
import 'package:neon/src/settings/widgets/dropdown_button_settings_tile.dart';
import 'package:neon/src/settings/widgets/settings_category.dart';
import 'package:neon/src/settings/widgets/settings_list.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
import 'package:neon/src/settings/widgets/text_settings_tile.dart';
import 'package:neon/src/utils/confirmation_dialog.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:neon/src/utils/save_file.dart';
import 'package:neon/src/utils/settings_export_helper.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
class SettingsPage extends StatefulWidget {
const SettingsPage({
@ -115,7 +142,7 @@ class _SettingsPageState extends State<SettingsPage> {
tiles: [
if (pushNotificationsEnabledEnabledSnapshot.hasData &&
!pushNotificationsEnabledEnabledSnapshot.requireData) ...[
NeonTextSettingsTile(
TextSettingsTile(
text: AppLocalizations.of(context).globalOptionsPushNotificationsEnabledDisabledNotice,
style: TextStyle(
fontWeight: FontWeight.w600,
@ -172,7 +199,7 @@ class _SettingsPageState extends State<SettingsPage> {
),
],
for (final account in accountsSnapshot.requireData) ...[
NeonAccountSettingsTile(
AccountSettingsTile(
account: account,
onTap: () {
AccountSettingsRoute(accountid: account.id).go(context);

36
packages/neon/neon/lib/src/platform/abstract.dart

@ -1,36 +0,0 @@
part of '../../neon.dart';
abstract class NeonPlatform {
NeonPlatform({
required this.canUseWebView,
required this.canUseWakelock,
required this.canUseQuickActions,
required this.canUseSystemTray,
required this.canUseWindowManager,
required this.canUseCamera,
required this.canUsePushNotifications,
required this.getApplicationCachePath,
required this.getUserAccessibleAppDataPath,
this.init,
});
final bool canUseWebView;
final bool canUseWakelock;
final bool canUseQuickActions;
final bool canUseSystemTray;
final bool canUseWindowManager;
final bool canUseCamera;
final bool canUsePushNotifications;
final Future<String> Function() getApplicationCachePath;
final Future<String> Function() getUserAccessibleAppDataPath;
final Future Function()? init;
}

8
packages/neon/neon/lib/src/platform/android.dart

@ -1,5 +1,11 @@
part of '../../neon.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/utils/exceptions.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
@internal
class AndroidNeonPlatform extends NeonPlatform {
AndroidNeonPlatform()
: super(

9
packages/neon/neon/lib/src/platform/linux.dart

@ -1,5 +1,12 @@
part of '../../neon.dart';
import 'dart:io';
import 'package:meta/meta.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:path/path.dart' as p;
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
import 'package:xdg_directories/xdg_directories.dart' as xdg;
@internal
class LinuxNeonPlatform extends NeonPlatform {
LinuxNeonPlatform()
: super(

40
packages/neon/neon/lib/src/platform/platform.dart

@ -1,4 +1,7 @@
part of '../../neon.dart';
import 'dart:io';
import 'package:neon/src/platform/android.dart';
import 'package:neon/src/platform/linux.dart';
Future<NeonPlatform> getNeonPlatform() async {
NeonPlatform? platform;
@ -16,3 +19,38 @@ Future<NeonPlatform> getNeonPlatform() async {
await platform.init?.call();
return platform;
}
abstract class NeonPlatform {
NeonPlatform({
required this.canUseWebView,
required this.canUseWakelock,
required this.canUseQuickActions,
required this.canUseSystemTray,
required this.canUseWindowManager,
required this.canUseCamera,
required this.canUsePushNotifications,
required this.getApplicationCachePath,
required this.getUserAccessibleAppDataPath,
this.init,
});
final bool canUseWebView;
final bool canUseWakelock;
final bool canUseQuickActions;
final bool canUseSystemTray;
final bool canUseWindowManager;
final bool canUseCamera;
final bool canUsePushNotifications;
final Future<String> Function() getApplicationCachePath;
final Future<String> Function() getUserAccessibleAppDataPath;
final Future Function()? init;
}

10
packages/neon/neon/lib/src/router.dart

@ -1,7 +1,15 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart';
import 'package:neon/neon.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/pages/account_settings.dart';
import 'package:neon/src/pages/home.dart';
import 'package:neon/src/pages/login.dart';
import 'package:neon/src/pages/nextcloud_app_settings.dart';
import 'package:neon/src/pages/settings.dart';
import 'package:neon/src/utils/stream_listenable.dart';
import 'package:provider/provider.dart';
part 'router.g.dart';

8
packages/neon/neon/lib/src/utils/nextcloud_app_specific_options.dart → packages/neon/neon/lib/src/settings/models/nextcloud_app_options.dart

@ -1,7 +1,9 @@
part of '../../neon.dart';
import 'package:neon/src/settings/models/option.dart';
import 'package:neon/src/settings/models/options_category.dart';
import 'package:neon/src/settings/models/storage.dart';
abstract class NextcloudAppSpecificOptions {
NextcloudAppSpecificOptions(this.storage);
abstract class NextcloudAppOptions {
NextcloudAppOptions(this.storage);
final AppStorage storage;
late final List<OptionsCategory> categories;

10
packages/settings/lib/src/options/option.dart → packages/neon/neon/lib/src/settings/models/option.dart

@ -1,8 +1,16 @@
part of '../../settings.dart';
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/models/options_category.dart';
import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:rxdart/rxdart.dart';
@internal
class OptionDisableException implements Exception {}
@immutable
@internal
abstract class Option<T> {
Option({
required this.storage,

2
packages/settings/lib/src/options/options_category.dart → packages/neon/neon/lib/src/settings/models/options_category.dart

@ -1,4 +1,4 @@
part of '../../settings.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
class OptionsCategory {
OptionsCategory({

6
packages/settings/lib/src/options/select_option.dart → packages/neon/neon/lib/src/settings/models/select_option.dart

@ -1,4 +1,8 @@
part of '../../settings.dart';
import 'dart:async';
import 'package:neon/src/settings/models/option.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:rxdart/rxdart.dart';
class SelectOption<T> extends Option<T> {
SelectOption({

13
packages/neon/neon/lib/src/utils/storage.dart → packages/neon/neon/lib/src/settings/models/storage.dart

@ -1,4 +1,15 @@
part of '../../neon.dart';
import 'package:shared_preferences/shared_preferences.dart';
abstract interface class SettingsStorage {
String? getString(final String key);
Future setString(final String key, final String value);
bool? getBool(final String key);
// ignore: avoid_positional_boolean_parameters
Future setBool(final String key, final bool value);
}
class AppStorage implements SettingsStorage {
AppStorage(

3
packages/settings/lib/src/options/toggle_option.dart → packages/neon/neon/lib/src/settings/models/toggle_option.dart

@ -1,4 +1,5 @@
part of '../../settings.dart';
import 'package:neon/src/settings/models/option.dart';
import 'package:rxdart/rxdart.dart';
class ToggleOption extends Option<bool> {
ToggleOption({

11
packages/neon/neon/lib/src/widgets/account_settings_tile.dart → packages/neon/neon/lib/src/settings/widgets/account_settings_tile.dart

@ -1,7 +1,12 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
import 'package:neon/src/widgets/account_tile.dart';
class NeonAccountSettingsTile extends SettingsTile {
const NeonAccountSettingsTile({
@internal
class AccountSettingsTile extends SettingsTile {
const AccountSettingsTile({
required this.account,
this.color,
this.trailing,

7
packages/settings/lib/src/widgets/checkbox_settings_tile.dart → packages/neon/neon/lib/src/settings/widgets/checkbox_settings_tile.dart

@ -1,5 +1,10 @@
part of '../../settings.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/models/toggle_option.dart';
import 'package:neon/src/settings/widgets/option_builder.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
@internal
class CheckBoxSettingsTile extends InputSettingsTile<ToggleOption> {
const CheckBoxSettingsTile({
required super.option,

5
packages/settings/lib/src/widgets/custom_settings_tile.dart → packages/neon/neon/lib/src/settings/widgets/custom_settings_tile.dart

@ -1,5 +1,8 @@
part of '../../settings.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
@internal
class CustomSettingsTile extends SettingsTile {
const CustomSettingsTile({
this.title,

8
packages/settings/lib/src/widgets/dropdown_button_settings_tile.dart → packages/neon/neon/lib/src/settings/widgets/dropdown_button_settings_tile.dart

@ -1,5 +1,11 @@
part of '../../settings.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/models/select_option.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:neon/src/settings/widgets/option_builder.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
@internal
class DropdownButtonSettingsTile<T> extends InputSettingsTile<SelectOption<T>> {
const DropdownButtonSettingsTile({
required super.option,

5
packages/neon/neon/lib/src/settings/widgets/label_builder.dart

@ -0,0 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
@internal
typedef LabelBuilder = String Function(BuildContext);

3
packages/settings/lib/src/widgets/option_builder.dart → packages/neon/neon/lib/src/settings/widgets/option_builder.dart

@ -1,4 +1,5 @@
part of '../../settings.dart';
import 'package:flutter/widgets.dart';
import 'package:neon/src/settings/models/option.dart';
typedef OptionBuilderFunction<T> = Widget Function(BuildContext context, T snapshot);

6
packages/settings/lib/src/widgets/settings_category.dart → packages/neon/neon/lib/src/settings/widgets/settings_category.dart

@ -1,5 +1,9 @@
part of '../../settings.dart';
import 'package:flutter/widgets.dart';
import 'package:intersperse/intersperse.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
@internal
class SettingsCategory extends StatelessWidget {
const SettingsCategory({
required this.tiles,

6
packages/settings/lib/src/widgets/settings_list.dart → packages/neon/neon/lib/src/settings/widgets/settings_list.dart

@ -1,5 +1,9 @@
part of '../../settings.dart';
import 'package:flutter/material.dart';
import 'package:intersperse/intersperse.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/widgets/settings_category.dart';
@internal
class SettingsList extends StatelessWidget {
const SettingsList({
required this.categories,

6
packages/settings/lib/src/widgets/settings_tile.dart → packages/neon/neon/lib/src/settings/widgets/settings_tile.dart

@ -1,11 +1,15 @@
part of '../../settings.dart';
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/models/option.dart';
@internal
abstract class SettingsTile extends StatelessWidget {
const SettingsTile({
super.key,
});
}
@internal
abstract class InputSettingsTile<T extends Option> extends SettingsTile {
const InputSettingsTile({
required this.option,

9
packages/neon/neon/lib/src/widgets/text_settings_tile.dart → packages/neon/neon/lib/src/settings/widgets/text_settings_tile.dart

@ -1,7 +1,10 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
class NeonTextSettingsTile extends SettingsTile {
const NeonTextSettingsTile({
@internal
class TextSettingsTile extends SettingsTile {
const TextSettingsTile({
required this.text,
this.style,
super.key,

5
packages/neon/neon/lib/src/utils/sort_box_builder.dart → packages/neon/neon/lib/src/sort_box/sort_box_builder.dart

@ -1,4 +1,7 @@
part of '../../neon.dart';
import 'package:flutter/widgets.dart';
import 'package:neon/src/settings/models/select_option.dart';
import 'package:neon/src/settings/widgets/option_builder.dart';
import 'package:sort_box/sort_box.dart';
class SortBoxBuilder<T extends Enum, R> extends StatelessWidget {
const SortBoxBuilder({

4
packages/neon/neon/lib/src/utils/sort_box_order_option_values.dart → packages/neon/neon/lib/src/sort_box/sort_box_order_option_values.dart

@ -1,4 +1,6 @@
part of '../../neon.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:sort_box/sort_box.dart';
final sortBoxOrderOptionValues = <SortBoxOrder, LabelBuilder>{
SortBoxOrder.ascending: (final context) => AppLocalizations.of(context).optionsSortOrderAscending,

12
packages/neon/neon/lib/src/utils/account_options.dart

@ -1,5 +1,15 @@
part of '../../neon.dart';
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/apps.dart';
import 'package:neon/src/settings/models/option.dart';
import 'package:neon/src/settings/models/select_option.dart';
import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:rxdart/rxdart.dart';
@internal
class AccountSpecificOptions {
AccountSpecificOptions(
this._storage,

3
packages/neon/neon/lib/src/utils/confirmation_dialog.dart

@ -1,4 +1,5 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:neon/l10n/localizations.dart';
Future<bool> showConfirmationDialog(final BuildContext context, final String title) async =>
await showDialog<bool>(

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

@ -1,4 +1,4 @@
part of '../../neon.dart';
import 'package:permission_handler/permission_handler.dart';
class MissingPermissionException implements Exception {
MissingPermissionException(this.permission);

4
packages/neon/neon/lib/src/utils/global.dart

@ -1,5 +1,7 @@
part of '../../neon.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/models/push_notification.dart';
@internal
class Global {
static Function(String accountID)? onPushNotificationReceived;
static Function(PushNotification notification)? onPushNotificationClicked;

18
packages/neon/neon/lib/src/utils/global_options.dart

@ -1,7 +1,23 @@
part of '../../neon.dart';
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/settings/models/option.dart';
import 'package:neon/src/settings/models/select_option.dart';
import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/settings/models/toggle_option.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:rxdart/rxdart.dart';
import 'package:shared_preferences/shared_preferences.dart';
const unifiedPushNextPushID = 'org.unifiedpush.distributor.nextpush';
@internal
class GlobalOptions {
GlobalOptions(
this._sharedPreferences,

11
packages/neon/neon/lib/src/utils/global_popups.dart

@ -1,5 +1,14 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/first_launch.dart';
import 'package:neon/src/blocs/next_push.dart';
import 'package:neon/src/router.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher_string.dart';
@internal
class GlobalPopups {
factory GlobalPopups() => instance ??= GlobalPopups._();

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

@ -1,4 +1,4 @@
part of '../../neon.dart';
import 'dart:ui';
class HexColor extends Color {
HexColor(final String hexColor) : super(_parse(hexColor));

7
packages/neon/neon/lib/src/utils/localizations.dart

@ -1,8 +1,13 @@
part of '../../neon.dart';
import 'dart:ui';
import 'package:intl/intl_standalone.dart';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
/// Loads the [AppLocalizations] for the system [Locale].
///
/// When the system locale is not supported [fallbackLocale] will be used.
@internal
Future<AppLocalizations> appLocalizationsFromSystem([final Locale fallbackLocale = const Locale('en', 'US')]) async {
final systemLocale = await findSystemLocale();
final parts = systemLocale.split('_').map((final a) => a.split('.')).expand((final e) => e).toList();

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

@ -1,5 +1,27 @@
part of '../../neon.dart';
import 'dart:convert';
import 'dart:ui';
import 'package:bitmap/bitmap.dart';
import 'package:crypto/crypto.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_svg/flutter_svg.dart' show SvgFileLoader, vg;
import 'package:meta/meta.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/push_notification.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/utils/global.dart';
import 'package:neon/src/utils/localizations.dart';
import 'package:neon/src/utils/request_manager.dart';
import 'package:neon/src/utils/theme.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:shared_preferences/shared_preferences.dart';
@internal
class PushUtils {
static Future<RSAKeypair> loadRSAKeypair(final AppStorage storage) async {
const keyDevicePrivateKey = 'device-private-key';

4
packages/neon/neon/lib/src/utils/rename_dialog.dart

@ -1,4 +1,6 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:neon/src/utils/validators.dart';
import 'package:neon/src/widgets/dialog.dart';
Future<String?> showRenameDialog({
required final BuildContext context,

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

@ -1,4 +1,13 @@
part of '../../neon.dart';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:path/path.dart' as p;
import 'package:rxdart/rxdart.dart';
import 'package:sqflite/sqflite.dart';
import 'package:xml/xml.dart' as xml;
class RequestManager {
RequestManager([

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

@ -1,4 +1,8 @@
part of '../../neon.dart';
import 'dart:io';
import 'dart:typed_data';
import 'package:file_picker/file_picker.dart';
import 'package:flutter_file_dialog/flutter_file_dialog.dart';
Future<String?> saveFileWithPickDialog(final String fileName, final Uint8List data) async {
if (Platform.isAndroid || Platform.isIOS) {

7
packages/neon/neon/lib/src/utils/settings_export_helper.dart

@ -1,5 +1,10 @@
part of '../../neon.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/settings/models/option.dart';
import 'package:neon/src/utils/global_options.dart';
@internal
class SettingsExportHelper {
SettingsExportHelper({
required this.globalOptions,

5
packages/neon/neon/lib/src/utils/stream_listenable.dart

@ -1,4 +1,7 @@
part of '../../neon.dart';
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:rxdart/rxdart.dart';
/// Listenable Stream
///

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

@ -1,7 +1,12 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/utils/hex_color.dart';
import 'package:nextcloud/nextcloud.dart';
@internal
const themePrimaryColor = Color(0xFFF37736);
@internal
ThemeData getThemeFromNextcloudTheme(
final CoreServerCapabilities_Ocs_Data_Capabilities_Theming? nextcloudTheme,
final Brightness brightness, {

3
packages/neon/neon/lib/src/utils/validators.dart

@ -1,4 +1,5 @@
part of '../../neon.dart';
import 'package:flutter/widgets.dart';
import 'package:neon/l10n/localizations.dart';
String? validateHttpUrl(
final BuildContext context,

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

@ -1,5 +1,15 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/result_builder.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:neon/src/widgets/linear_progress_indicator.dart';
import 'package:neon/src/widgets/user_avatar.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:provider/provider.dart';
@internal
class NeonAccountTile extends StatelessWidget {
const NeonAccountTile({
required this.account,

11
packages/neon/neon/lib/src/widgets/app_bar.dart

@ -3,8 +3,17 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/neon.dart';
import 'package:neon/src/bloc/result_builder.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/blocs/apps.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/models/notifications_interface.dart';
import 'package:neon/src/router.dart';
import 'package:neon/src/widgets/app_implementation_icon.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:neon/src/widgets/linear_progress_indicator.dart';
import 'package:neon/src/widgets/user_avatar.dart';
import 'package:provider/provider.dart';
@internal

6
packages/neon/neon/lib/src/widgets/app_implementation_icon.dart

@ -1,5 +1,9 @@
part of '../../neon.dart';
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/widgets/user_avatar.dart';
@internal
class NeonAppImplementationIcon extends StatelessWidget {
const NeonAppImplementationIcon({
required this.appImplementation,

10
packages/neon/neon/lib/src/widgets/cached_image.dart

@ -1,4 +1,12 @@
part of '../../neon.dart';
import 'dart:async';
import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:neon/src/widgets/linear_progress_indicator.dart';
typedef CacheReviver = FutureOr<Uint8List?> Function(CacheManager cacheManager);
typedef ImageDownloader = FutureOr<Uint8List> Function();

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

@ -1,4 +1,4 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
class NeonDialog extends StatelessWidget {
const NeonDialog({

11
packages/neon/neon/lib/src/widgets/drawer.dart

@ -3,9 +3,18 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/neon.dart';
import 'package:neon/src/bloc/result_builder.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/blocs/apps.dart';
import 'package:neon/src/blocs/capabilities.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/router.dart';
import 'package:neon/src/widgets/account_tile.dart';
import 'package:neon/src/widgets/cached_image.dart';
import 'package:neon/src/widgets/drawer_destination.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:neon/src/widgets/linear_progress_indicator.dart';
import 'package:provider/provider.dart';
@internal

9
packages/neon/neon/lib/src/widgets/drawer_destination.dart

@ -1,9 +1,12 @@
import 'package:flutter/material.dart';
import 'package:neon/neon.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/widgets/user_avatar.dart';
import 'package:rxdart/subjects.dart';
@internal
typedef DestinationIconBuilder = Widget Function({Size size, Color color});
@internal
class NeonNavigationDestination {
const NeonNavigationDestination({
required this.label,
@ -18,6 +21,7 @@ class NeonNavigationDestination {
final BehaviorSubject<int>? notificationCount;
}
@internal
extension NavigationDestinationExtension on NavigationDestination {
static NavigationDestination fromNeonDestination(final NeonNavigationDestination neonDestination) =>
NavigationDestination(
@ -27,6 +31,7 @@ extension NavigationDestinationExtension on NavigationDestination {
);
}
@internal
extension NavigationRailDestinationExtension on NavigationRailDestination {
static NavigationRailDestination fromNeonDestination(final NeonNavigationDestination neonDestination) {
final iconWIdget = StreamBuilder(
@ -79,6 +84,7 @@ extension NavigationRailDestinationExtension on NavigationRailDestination {
}
}
@internal
extension NavigationDrawerDestinationExtension on NavigationDrawerDestination {
static NavigationDrawerDestination fromNeonDestination(final NeonNavigationDestination neonDestination) {
final labelWidget = StreamBuilder(
@ -129,6 +135,7 @@ extension NavigationDrawerDestinationExtension on NavigationDrawerDestination {
}
}
@internal
extension TabExtension on Tab {
static Tab fromNeonDestination(final NeonNavigationDestination neonDestination) => Tab(
text: neonDestination.label,

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

@ -1,4 +1,14 @@
part of '../../neon.dart';
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/router.dart';
import 'package:neon/src/utils/exceptions.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:provider/provider.dart';
class NeonException extends StatelessWidget {
const NeonException(

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

@ -1,4 +1,4 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
class NeonImageWrapper extends StatelessWidget {
const NeonImageWrapper({

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

@ -1,4 +1,4 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
class NeonLinearProgressIndicator extends StatelessWidget {
const NeonLinearProgressIndicator({

4
packages/neon/neon/lib/src/widgets/list_view.dart

@ -1,4 +1,6 @@
part of '../../neon.dart';
import 'package:flutter/material.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:neon/src/widgets/linear_progress_indicator.dart';
class NeonListView<T> extends StatelessWidget {
const NeonListView({

3
packages/neon/neon/lib/src/widgets/nextcloud_logo.dart

@ -1,4 +1,5 @@
part of '../../neon.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_svg/flutter_svg.dart';
class NextcloudLogo extends StatelessWidget {
const NextcloudLogo({

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

@ -1,4 +1,4 @@
part of '../../neon.dart';
import 'package:flutter/widgets.dart';
class RelativeTime extends StatelessWidget {
const RelativeTime({

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

@ -1,7 +1,17 @@
// ignore_for_file: use_late_for_private_fields_and_variables
// ^ This is a really strange false positive, it goes of at a very random place without any meaning. Hopefully fixed soon?
part of '../../neon.dart';
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/bloc/result_builder.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/widgets/cached_image.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
const kAvatarSize = 40.0;

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

@ -0,0 +1,6 @@
export 'package:neon/src/utils/confirmation_dialog.dart';
export 'package:neon/src/utils/exceptions.dart';
export 'package:neon/src/utils/hex_color.dart';
export 'package:neon/src/utils/rename_dialog.dart';
export 'package:neon/src/utils/request_manager.dart';
export 'package:neon/src/utils/validators.dart';

7
packages/neon/neon/lib/widgets.dart

@ -0,0 +1,7 @@
export 'package:neon/src/widgets/cached_image.dart';
export 'package:neon/src/widgets/dialog.dart';
export 'package:neon/src/widgets/exception.dart';
export 'package:neon/src/widgets/image_wrapper.dart';
export 'package:neon/src/widgets/linear_progress_indicator.dart';
export 'package:neon/src/widgets/list_view.dart';
export 'package:neon/src/widgets/relative_time.dart';

5
packages/neon/neon/pubspec.yaml

@ -23,6 +23,7 @@ dependencies:
flutter_svg: ^2.0.5
go_router: ^8.0.3
http: ^0.13.6
intersperse: ^2.0.0
intl: ^0.18.0
json_annotation: ^4.8.1
material_design_icons_flutter: ^7.0.7296
@ -38,10 +39,6 @@ dependencies:
provider: ^6.0.5
quick_actions: ^1.0.3
rxdart: ^0.27.7
settings:
git:
url: https://github.com/provokateurin/nextcloud-neon
path: packages/settings
shared_preferences: ^2.1.1
sort_box:
git:

4
packages/neon/neon/pubspec_overrides.yaml

@ -1,11 +1,9 @@
# melos_managed_dependency_overrides: dynamite_runtime,nextcloud,settings,sort_box,wakelock_windows
# melos_managed_dependency_overrides: dynamite_runtime,nextcloud,sort_box,wakelock_windows
dependency_overrides:
dynamite_runtime:
path: ../../dynamite/dynamite_runtime
nextcloud:
path: ../../nextcloud
settings:
path: ../../settings
sort_box:
path: ../../sort_box
wakelock_windows:

2
packages/neon/neon/test/hex_color_test.dart

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:neon/neon.dart';
import 'package:neon/utils.dart';
import 'package:test/test.dart';
void main() {

2
packages/neon/neon/test/result_test.dart

@ -1,4 +1,4 @@
import 'package:neon/neon.dart';
import 'package:neon/blocs.dart';
import 'package:test/test.dart';
void main() {

2
packages/neon/neon/test/timer_bloc_test.dart

@ -1,4 +1,4 @@
import 'package:neon/neon.dart';
import 'package:neon/blocs.dart';
import 'package:test/test.dart';
void main() {

10
packages/neon/neon_files/lib/neon_files.dart

@ -12,7 +12,13 @@ import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intersperse/intersperse.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:neon/neon.dart';
import 'package:neon/blocs.dart';
import 'package:neon/models.dart';
import 'package:neon/platform.dart';
import 'package:neon/settings.dart';
import 'package:neon/sort_box.dart';
import 'package:neon/utils.dart';
import 'package:neon/widgets.dart';
import 'package:neon_files/l10n/localizations.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:open_file/open_file.dart';
@ -20,8 +26,6 @@ import 'package:path/path.dart' as p;
import 'package:provider/provider.dart';
import 'package:queue/queue.dart';
import 'package:rxdart/rxdart.dart';
import 'package:settings/settings.dart';
import 'package:sort_box/sort_box.dart';
part 'blocs/browser.dart';
part 'blocs/files.dart';

2
packages/neon/neon_files/lib/options.dart

@ -1,6 +1,6 @@
part of 'neon_files.dart';
class FilesAppSpecificOptions extends NextcloudAppSpecificOptions {
class FilesAppSpecificOptions extends NextcloudAppOptions {
FilesAppSpecificOptions(super.storage) {
super.categories = [
generalCategory,

8
packages/neon/neon_files/pubspec.yaml

@ -32,15 +32,7 @@ dependencies:
provider: ^6.0.5
queue: ^3.1.0+2
rxdart: ^0.27.7
settings:
git:
url: https://github.com/provokateurin/nextcloud-neon
path: packages/settings
share_plus: ^7.0.0
sort_box:
git:
url: https://github.com/provokateurin/nextcloud-neon
path: packages/sort_box
dev_dependencies:
nit_picking:

4
packages/neon/neon_files/pubspec_overrides.yaml

@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: dynamite_runtime,file_icons,neon,nextcloud,settings,sort_box
# melos_managed_dependency_overrides: dynamite_runtime,file_icons,neon,nextcloud,sort_box
dependency_overrides:
dynamite_runtime:
path: ../../dynamite/dynamite_runtime
@ -8,7 +8,5 @@ dependency_overrides:
path: ../neon
nextcloud:
path: ../../nextcloud
settings:
path: ../../settings
sort_box:
path: ../../sort_box

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

@ -18,7 +18,6 @@ abstract class NewsArticleBlocStates {
class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents, NewsArticleBlocStates {
NewsArticleBloc(
this._client,
this._newsArticlesBloc,
final NewsArticle article,
) {
@ -27,7 +26,6 @@ class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents,
starred.add(article.starred);
}
final NextcloudClient _client;
final NewsArticlesBloc _newsArticlesBloc;
late final int _id;
@ -51,7 +49,7 @@ class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents,
@override
void markArticleAsRead() {
_wrapArticleAction(() async {
await _client.news.markArticleAsRead(itemId: _id);
await _newsArticlesBloc.client.news.markArticleAsRead(itemId: _id);
unread.add(false);
});
}
@ -59,7 +57,7 @@ class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents,
@override
void markArticleAsUnread() {
_wrapArticleAction(() async {
await _client.news.markArticleAsUnread(itemId: _id);
await _newsArticlesBloc.client.news.markArticleAsUnread(itemId: _id);
unread.add(true);
});
}
@ -67,7 +65,7 @@ class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents,
@override
void starArticle() {
_wrapArticleAction(() async {
await _client.news.starArticle(itemId: _id);
await _newsArticlesBloc.client.news.starArticle(itemId: _id);
starred.add(true);
});
}
@ -75,7 +73,7 @@ class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents,
@override
void unstarArticle() {
_wrapArticleAction(() async {
await _client.news.unstarArticle(itemId: _id);
await _newsArticlesBloc.client.news.unstarArticle(itemId: _id);
starred.add(false);
});
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save