Browse Source

settings,neon: Move settings into neon

pull/436/head
jld3103 2 years ago
parent
commit
fad76be56b
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 11
      packages/app/pubspec.lock
  2. 4
      packages/app/pubspec_overrides.yaml
  3. 6
      packages/neon/neon/lib/settings.dart
  4. 2
      packages/neon/neon/lib/src/app.dart
  5. 2
      packages/neon/neon/lib/src/blocs/accounts.dart
  6. 4
      packages/neon/neon/lib/src/blocs/apps.dart
  7. 2
      packages/neon/neon/lib/src/blocs/push_notifications.dart
  8. 4
      packages/neon/neon/lib/src/interfaces/notifications.dart
  9. 5
      packages/neon/neon/lib/src/pages/account_settings.dart
  10. 2
      packages/neon/neon/lib/src/pages/home.dart
  11. 7
      packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart
  12. 15
      packages/neon/neon/lib/src/pages/settings.dart
  13. 9
      packages/neon/neon/lib/src/settings/models/nextcloud_app_options.dart
  14. 8
      packages/neon/neon/lib/src/settings/models/option.dart
  15. 2
      packages/neon/neon/lib/src/settings/models/options_category.dart
  16. 6
      packages/neon/neon/lib/src/settings/models/select_option.dart
  17. 12
      packages/neon/neon/lib/src/settings/models/storage.dart
  18. 3
      packages/neon/neon/lib/src/settings/models/toggle_option.dart
  19. 6
      packages/neon/neon/lib/src/settings/widgets/account_settings_tile.dart
  20. 5
      packages/neon/neon/lib/src/settings/widgets/checkbox_settings_tile.dart
  21. 3
      packages/neon/neon/lib/src/settings/widgets/custom_settings_tile.dart
  22. 6
      packages/neon/neon/lib/src/settings/widgets/dropdown_button_settings_tile.dart
  23. 2
      packages/neon/neon/lib/src/settings/widgets/label_builder.dart
  24. 3
      packages/neon/neon/lib/src/settings/widgets/option_builder.dart
  25. 4
      packages/neon/neon/lib/src/settings/widgets/settings_category.dart
  26. 4
      packages/neon/neon/lib/src/settings/widgets/settings_list.dart
  27. 3
      packages/neon/neon/lib/src/settings/widgets/settings_tile.dart
  28. 6
      packages/neon/neon/lib/src/settings/widgets/text_settings_tile.dart
  29. 6
      packages/neon/neon/lib/src/utils/account_options.dart
  30. 6
      packages/neon/neon/lib/src/utils/app_implementation.dart
  31. 7
      packages/neon/neon/lib/src/utils/global_options.dart
  32. 2
      packages/neon/neon/lib/src/utils/push_utils.dart
  33. 2
      packages/neon/neon/lib/src/utils/settings_export_helper.dart
  34. 3
      packages/neon/neon/lib/src/utils/sort_box_builder.dart
  35. 2
      packages/neon/neon/lib/src/utils/sort_box_order_option_values.dart
  36. 2
      packages/neon/neon/lib/utils.dart
  37. 5
      packages/neon/neon/pubspec.yaml
  38. 4
      packages/neon/neon/pubspec_overrides.yaml
  39. 2
      packages/neon/neon_files/lib/neon_files.dart
  40. 2
      packages/neon/neon_files/lib/options.dart
  41. 4
      packages/neon/neon_files/pubspec.yaml
  42. 4
      packages/neon/neon_files/pubspec_overrides.yaml
  43. 2
      packages/neon/neon_news/lib/neon_news.dart
  44. 2
      packages/neon/neon_news/lib/options.dart
  45. 4
      packages/neon/neon_news/pubspec.yaml
  46. 4
      packages/neon/neon_news/pubspec_overrides.yaml
  47. 2
      packages/neon/neon_notes/lib/neon_notes.dart
  48. 2
      packages/neon/neon_notes/lib/options.dart
  49. 4
      packages/neon/neon_notes/pubspec.yaml
  50. 4
      packages/neon/neon_notes/pubspec_overrides.yaml
  51. 1
      packages/neon/neon_notifications/lib/neon_notifications.dart
  52. 2
      packages/neon/neon_notifications/lib/options.dart
  53. 4
      packages/neon/neon_notifications/pubspec_overrides.yaml
  54. 30
      packages/settings/.gitignore
  55. 10
      packages/settings/.metadata
  56. 1
      packages/settings/LICENSE
  57. 3
      packages/settings/README.md
  58. 1
      packages/settings/analysis_options.yaml
  59. 21
      packages/settings/lib/settings.dart
  60. 12
      packages/settings/lib/src/storage/storage.dart
  61. 18
      packages/settings/pubspec.yaml

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:

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';

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

@ -13,6 +13,7 @@ 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/router.dart';
import 'package:neon/src/settings/widgets/option_builder.dart';
import 'package:neon/src/utils/app_implementation.dart';
import 'package:neon/src/utils/global.dart';
import 'package:neon/src/utils/global_options.dart';
@ -21,7 +22,6 @@ 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:settings/settings.dart';
import 'package:tray_manager/tray_manager.dart' as tray;
import 'package:window_manager/window_manager.dart';

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

@ -9,11 +9,11 @@ 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/platform/platform.dart';
import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/utils/account_options.dart';
import 'package:neon/src/utils/app_implementation.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:neon/src/utils/request_manager.dart';
import 'package:neon/src/utils/storage.dart';
import 'package:rxdart/rxdart.dart';
import 'package:shared_preferences/shared_preferences.dart';

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

@ -7,8 +7,8 @@ import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/blocs/capabilities.dart';
import 'package:neon/src/interfaces/notifications.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/settings/models/nextcloud_app_options.dart';
import 'package:neon/src/utils/app_implementation.dart';
import 'package:neon/src/utils/nextcloud_app_specific_options.dart';
import 'package:neon/src/utils/request_manager.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:provider/provider.dart';
@ -161,7 +161,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

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

@ -7,9 +7,9 @@ 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:neon/src/utils/storage.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:unifiedpush/unifiedpush.dart';

4
packages/neon/neon/lib/src/interfaces/notifications.dart

@ -1,6 +1,6 @@
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/settings/models/nextcloud_app_options.dart';
import 'package:neon/src/utils/app_implementation.dart';
import 'package:neon/src/utils/nextcloud_app_specific_options.dart';
abstract interface class NotificationsAppInterface<T extends NotificationsBlocInterface,
R extends NotificationsOptionsInterface> extends AppImplementation<T, R> {
@ -18,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);
}

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

@ -6,11 +6,14 @@ 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';
import 'package:settings/settings.dart';
class AccountSettingsPage extends StatelessWidget {
AccountSettingsPage({

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

@ -6,6 +6,7 @@ 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/settings/widgets/option_builder.dart';
import 'package:neon/src/utils/app_implementation.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:neon/src/utils/global_options.dart' as global_options;
@ -15,7 +16,6 @@ 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';
import 'package:settings/settings.dart';
const kQuickBarWidth = kAvatarSize + 20;

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

@ -1,9 +1,14 @@
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/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/app_implementation.dart';
import 'package:neon/src/utils/confirmation_dialog.dart';
import 'package:settings/settings.dart';
class NextcloudAppSettingsPage extends StatelessWidget {
const NextcloudAppSettingsPage({

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

@ -9,18 +9,23 @@ 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/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/app_implementation.dart';
import 'package:neon/src/utils/branding.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/account_settings_tile.dart';
import 'package:neon/src/widgets/exception.dart';
import 'package:neon/src/widgets/text_settings_tile.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
import 'package:settings/settings.dart';
class SettingsPage extends StatefulWidget {
const SettingsPage({
@ -137,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,
@ -194,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);

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

@ -1,8 +1,9 @@
import 'package:neon/src/utils/storage.dart';
import 'package:settings/settings.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;

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

@ -1,4 +1,10 @@
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';
class OptionDisableException implements Exception {}

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({

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

@ -1,6 +1,16 @@
import 'package:settings/settings.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(
this._id,

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({

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

@ -1,10 +1,10 @@
import 'package:flutter/material.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';
import 'package:settings/settings.dart';
class NeonAccountSettingsTile extends SettingsTile {
const NeonAccountSettingsTile({
class AccountSettingsTile extends SettingsTile {
const AccountSettingsTile({
required this.account,
this.color,
this.trailing,

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

@ -1,4 +1,7 @@
part of '../../settings.dart';
import 'package:flutter/material.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';
class CheckBoxSettingsTile extends InputSettingsTile<ToggleOption> {
const CheckBoxSettingsTile({

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

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

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

@ -1,4 +1,8 @@
part of '../../settings.dart';
import 'package:flutter/material.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';
class DropdownButtonSettingsTile<T> extends InputSettingsTile<SelectOption<T>> {
const DropdownButtonSettingsTile({

2
packages/settings/lib/src/options/label_builder.dart → packages/neon/neon/lib/src/settings/widgets/label_builder.dart

@ -1,3 +1,3 @@
part of '../../settings.dart';
import 'package:flutter/widgets.dart';
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);

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

@ -1,4 +1,6 @@
part of '../../settings.dart';
import 'package:flutter/widgets.dart';
import 'package:intersperse/intersperse.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
class SettingsCategory extends StatelessWidget {
const SettingsCategory({

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

@ -1,4 +1,6 @@
part of '../../settings.dart';
import 'package:flutter/material.dart';
import 'package:intersperse/intersperse.dart';
import 'package:neon/src/settings/widgets/settings_category.dart';
class SettingsList extends StatelessWidget {
const SettingsList({

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

@ -1,4 +1,5 @@
part of '../../settings.dart';
import 'package:flutter/widgets.dart';
import 'package:neon/src/settings/models/option.dart';
abstract class SettingsTile extends StatelessWidget {
const SettingsTile({

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

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

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

@ -2,9 +2,11 @@ import 'dart:async';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/apps.dart';
import 'package:neon/src/utils/storage.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';
import 'package:settings/settings.dart';
class AccountSpecificOptions {
AccountSpecificOptions(

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

@ -6,16 +6,16 @@ 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/utils/nextcloud_app_specific_options.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/utils/storage.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 NextcloudAppSpecificOptions> {
abstract class AppImplementation<T extends Bloc, R extends NextcloudAppOptions> {
AppImplementation(
final SharedPreferences sharedPreferences,
this.requestManager,

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

@ -4,11 +4,14 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/utils/storage.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:settings/settings.dart';
import 'package:shared_preferences/shared_preferences.dart';
const unifiedPushNextPushID = 'org.unifiedpush.distributor.nextpush';

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

@ -12,10 +12,10 @@ 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/storage.dart';
import 'package:neon/src/utils/theme.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:shared_preferences/shared_preferences.dart';

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

@ -1,7 +1,7 @@
import 'package:neon/src/models/account.dart';
import 'package:neon/src/settings/models/option.dart';
import 'package:neon/src/utils/app_implementation.dart';
import 'package:neon/src/utils/global_options.dart';
import 'package:settings/settings.dart';
class SettingsExportHelper {
SettingsExportHelper({

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

@ -1,5 +1,6 @@
import 'package:flutter/widgets.dart';
import 'package:settings/settings.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 {

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

@ -1,5 +1,5 @@
import 'package:neon/l10n/localizations.dart';
import 'package:settings/settings.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:sort_box/sort_box.dart';
final sortBoxOrderOptionValues = <SortBoxOrder, LabelBuilder>{

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

@ -3,10 +3,8 @@ export 'package:neon/src/utils/branding.dart';
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/nextcloud_app_specific_options.dart';
export 'package:neon/src/utils/rename_dialog.dart';
export 'package:neon/src/utils/request_manager.dart';
export 'package:neon/src/utils/sort_box_builder.dart';
export 'package:neon/src/utils/sort_box_order_option_values.dart';
export 'package:neon/src/utils/storage.dart';
export 'package:neon/src/utils/validators.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_files/lib/neon_files.dart

@ -15,6 +15,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
import 'package:neon/blocs.dart';
import 'package:neon/models.dart';
import 'package:neon/platform.dart';
import 'package:neon/settings.dart';
import 'package:neon/utils.dart';
import 'package:neon/widgets.dart';
import 'package:neon_files/l10n/localizations.dart';
@ -24,7 +25,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';

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,

4
packages/neon/neon_files/pubspec.yaml

@ -32,10 +32,6 @@ 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:

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

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

@ -11,13 +11,13 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
import 'package:neon/blocs.dart';
import 'package:neon/models.dart';
import 'package:neon/platform.dart';
import 'package:neon/settings.dart';
import 'package:neon/utils.dart';
import 'package:neon/widgets.dart';
import 'package:neon_news/l10n/localizations.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
import 'package:settings/settings.dart';
import 'package:share_plus/share_plus.dart';
import 'package:sort_box/sort_box.dart';
import 'package:url_launcher/url_launcher_string.dart';

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

@ -1,6 +1,6 @@
part of 'neon_news.dart';
class NewsAppSpecificOptions extends NextcloudAppSpecificOptions {
class NewsAppSpecificOptions extends NextcloudAppOptions {
NewsAppSpecificOptions(super.storage, final NeonPlatform platform) {
super.categories = [
generalCategory,

4
packages/neon/neon_news/pubspec.yaml

@ -22,10 +22,6 @@ dependencies:
path: packages/nextcloud
provider: ^6.0.5
rxdart: ^0.27.7
settings:
git:
url: https://github.com/provokateurin/nextcloud-neon
path: packages/settings
share_plus: ^7.0.0
sort_box:
git:

4
packages/neon/neon_news/pubspec_overrides.yaml

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

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

@ -11,6 +11,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
import 'package:neon/blocs.dart';
import 'package:neon/models.dart';
import 'package:neon/platform.dart';
import 'package:neon/settings.dart';
import 'package:neon/utils.dart';
import 'package:neon/widgets.dart';
import 'package:neon_notes/l10n/localizations.dart';
@ -18,7 +19,6 @@ import 'package:nextcloud/nextcloud.dart';
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';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:wakelock/wakelock.dart';

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

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

4
packages/neon/neon_notes/pubspec.yaml

@ -24,10 +24,6 @@ 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
sort_box:
git:
url: https://github.com/provokateurin/nextcloud-neon

4
packages/neon/neon_notes/pubspec_overrides.yaml

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

1
packages/neon/neon_notifications/lib/neon_notifications.dart

@ -7,6 +7,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
import 'package:neon/blocs.dart';
import 'package:neon/interfaces.dart';
import 'package:neon/models.dart';
import 'package:neon/settings.dart';
import 'package:neon/utils.dart';
import 'package:neon/widgets.dart';
import 'package:neon_notifications/l10n/localizations.dart';

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

@ -1,6 +1,6 @@
part of 'neon_notifications.dart';
class NotificationsAppSpecificOptions extends NextcloudAppSpecificOptions implements NotificationsOptionsInterface {
class NotificationsAppSpecificOptions extends NextcloudAppOptions implements NotificationsOptionsInterface {
NotificationsAppSpecificOptions(super.storage) {
super.categories = [];
super.options = [];

4
packages/neon/neon_notifications/pubspec_overrides.yaml

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

30
packages/settings/.gitignore vendored

@ -1,30 +0,0 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/

10
packages/settings/.metadata

@ -1,10 +0,0 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 7a2b187c7bc47de1578992a225e64bbc6ad1eb4a
channel: master
project_type: package

1
packages/settings/LICENSE

@ -1 +0,0 @@
../../LICENSE

3
packages/settings/README.md

@ -1,3 +0,0 @@
# settings
A framework for modular settings in Flutter.

1
packages/settings/analysis_options.yaml

@ -1 +0,0 @@
include: package:nit_picking/flutter.yaml

21
packages/settings/lib/settings.dart

@ -1,21 +0,0 @@
library settings;
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:intersperse/intersperse.dart';
import 'package:rxdart/rxdart.dart';
part 'src/options/label_builder.dart';
part 'src/options/option.dart';
part 'src/options/options_category.dart';
part 'src/options/select_option.dart';
part 'src/options/toggle_option.dart';
part 'src/storage/storage.dart';
part 'src/widgets/checkbox_settings_tile.dart';
part 'src/widgets/custom_settings_tile.dart';
part 'src/widgets/dropdown_button_settings_tile.dart';
part 'src/widgets/option_builder.dart';
part 'src/widgets/settings_category.dart';
part 'src/widgets/settings_list.dart';
part 'src/widgets/settings_tile.dart';

12
packages/settings/lib/src/storage/storage.dart

@ -1,12 +0,0 @@
part of '../../settings.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);
}

18
packages/settings/pubspec.yaml

@ -1,18 +0,0 @@
name: settings
version: 1.0.0
environment:
sdk: '>=3.0.0 <4.0.0'
flutter: '>=3.10.4'
dependencies:
flutter:
sdk: flutter
intersperse: ^2.0.0
rxdart: ^0.27.7
dev_dependencies:
nit_picking:
git:
url: https://github.com/stack11/dart_nit_picking
ref: 0b2ee0d
Loading…
Cancel
Save