From 038a1082d02c04c41e86c6374d4e05a0e36c200e Mon Sep 17 00:00:00 2001 From: Jagandeep Brar Date: Mon, 2 May 2022 20:49:09 -0400 Subject: [PATCH] chore: refactor and move some system services --- build.yaml | 2 +- lib/core.dart | 3 +- .../image_cache/platform/image_cache_io.dart | 2 +- lib/core/database/database.dart | 2 +- lib/core/firebase/core.dart | 2 +- lib/core/firebase/messaging.dart | 2 +- lib/core/models/logs/log_type.dart | 4 +- lib/core/modules.dart | 8 +- lib/core/system.dart | 2 - lib/core/system/in_app_purchases.dart | 2 +- lib/core/system/networking/networking.dart | 10 --- .../networking/platform/networking_html.dart | 5 -- .../networking/platform/networking_stub.dart | 5 -- lib/core/system/quick_actions.dart | 45 ----------- lib/core/utilities/changelog.dart | 4 +- lib/main.dart | 21 ++--- lib/modules/dashboard/core/api/api.dart | 2 +- .../dashboard/core/api/data/lidarr.dart | 2 +- .../dashboard/core/api/data/radarr.dart | 2 +- .../dashboard/core/api/data/sonarr.dart | 2 +- lib/modules/dashboard/core/dialogs.dart | 2 +- .../routes/dashboard/pages/calendar.dart | 3 +- .../routes/dashboard/pages/modules.dart | 2 +- .../dashboard/routes/dashboard/route.dart | 2 +- .../dashboard/widgets/calendar_view.dart | 2 +- .../dashboard/widgets/content_block.dart | 2 +- .../dashboard/widgets/schedule_view.dart | 2 +- .../dashboard/widgets/switch_view_action.dart | 3 +- lib/modules/nzbget/routes/nzbget.dart | 4 +- lib/modules/sabnzbd/routes/sabnzbd.dart | 4 +- .../search/core/types/download_type.dart | 2 +- lib/modules/settings/core/dialogs.dart | 6 +- .../settings/routes/configuration/route.dart | 9 ++- .../pages/calendar_settings.dart | 3 +- .../configuration_localization/route.dart | 2 + .../routes/configuration_network/route.dart | 4 +- .../configuration_quickactions/route.dart | 5 +- .../settings/routes/settings/route.dart | 4 +- lib/modules/settings/routes/system/route.dart | 4 +- .../routes/system/widgets/backup_tile.dart | 2 +- .../routes/system/widgets/restore_tile.dart | 4 +- .../settings/routes/system_logs/route.dart | 2 +- .../api/platform/wake_on_lan_io.dart | 2 +- lib/system/{build => }/environment.dart | 2 +- lib/{core => }/system/filesystem/file.dart | 0 .../system/filesystem/filesystem.dart | 0 .../filesystem/platform/filesystem_html.dart | 0 .../filesystem/platform/filesystem_io.dart | 4 +- .../filesystem/platform/filesystem_stub.dart | 0 lib/system/{build => }/flavor.dart | 2 +- lib/{core => }/system/localization.dart | 24 +++--- lib/system/network/network.dart | 10 +++ lib/system/network/platform/network_html.dart | 4 + .../network/platform/network_io.dart} | 8 +- lib/system/network/platform/network_stub.dart | 4 + lib/{core => }/system/platform.dart | 0 .../platform/quick_actions_html.dart | 5 ++ .../platform/quick_actions_io.dart | 50 ++++++++++++ .../platform/quick_actions_stub.dart | 5 ++ lib/system/quick_actions/quick_actions.dart | 12 +++ .../platform/window_manager_html.dart | 0 .../platform/window_manager_io.dart | 0 .../platform/window_manager_stub.dart | 0 .../system/window_manager/window_manager.dart | 0 lib/{core => }/ui/appbar.dart | 0 lib/{core => }/ui/banner.dart | 0 lib/{core => }/ui/block.dart | 0 lib/{core => }/ui/block/block.dart | 0 lib/{core => }/ui/block/grid_block.dart | 0 lib/{core => }/ui/bottom_bar.dart | 0 lib/{core => }/ui/bottom_bar/action_bar.dart | 0 .../ui/bottom_bar/action_bar_card.dart | 0 lib/{core => }/ui/bottom_bar/badge.dart | 0 .../ui/bottom_bar/navigation_bar.dart | 0 lib/{core => }/ui/bottom_modal_sheet.dart | 0 lib/{core => }/ui/button.dart | 0 lib/{core => }/ui/card.dart | 0 lib/{core => }/ui/colors.dart | 0 lib/{core => }/ui/containers.dart | 0 .../ui/containers/button_container.dart | 0 lib/{core => }/ui/controllers.dart | 0 .../ui/controllers/page_controller.dart | 0 lib/{core => }/ui/deprecated.dart | 0 lib/{core => }/ui/dialog.dart | 0 lib/{core => }/ui/divider.dart | 0 lib/{core => }/ui/drawer.dart | 0 lib/{core => }/ui/drawer/drawer.dart | 0 lib/{core => }/ui/drawer/drawer_header.dart | 0 lib/{core => }/ui/floating_action_button.dart | 0 .../floating_action_button_animated.dart | 0 .../floating_action_button_extended.dart | 0 lib/{core => }/ui/grid_view.dart | 0 .../ui/grid_view/grid_view_builder.dart | 0 lib/{core => }/ui/header.dart | 0 lib/{core => }/ui/highlighted_node.dart | 0 lib/{core => }/ui/icons.dart | 0 lib/{core => }/ui/icons/icon.dart | 0 lib/{core => }/ui/icons/icon_brands.dart | 0 lib/{core => }/ui/icons/icon_button.dart | 0 lib/{core => }/ui/images.dart | 0 lib/{core => }/ui/images/network_image.dart | 0 .../network_image_provider.dart | 0 .../platform/network_image_provider_html.dart | 0 .../platform/network_image_provider_io.dart | 2 +- .../platform/network_image_provider_stub.dart | 0 lib/{core => }/ui/input_bar.dart | 0 lib/{core => }/ui/linear_indicator.dart | 0 lib/{core => }/ui/list_tile.dart | 0 .../ui/list_tile/expandable_list_tile.dart | 0 lib/{core => }/ui/list_tile/list_tile.dart | 0 lib/{core => }/ui/list_view.dart | 0 .../flutter_reorderable_list_view.dart | 0 lib/{core => }/ui/list_view/list_view.dart | 0 .../ui/list_view/list_view_builder.dart | 0 .../ui/list_view/list_view_modal.dart | 0 .../ui/list_view/list_view_modal_builder.dart | 0 .../ui/list_view/paged_list_view.dart | 0 .../ui/list_view/reorderable_list_view.dart | 0 .../reorderable_list_view_builder.dart | 0 .../reorderable_list_view_dragger.dart | 0 lib/{core => }/ui/loader.dart | 0 lib/{core => }/ui/message.dart | 0 lib/{core => ui}/mixins.dart | 0 lib/{core => ui}/mixins/load_callback.dart | 0 .../mixins/scroll_controller.dart | 0 lib/{core => }/ui/page_view.dart | 0 lib/{core => }/ui/popup_menu_button.dart | 0 lib/{core => }/ui/refresh_indicator.dart | 0 lib/{core => }/ui/scaffold.dart | 0 lib/{core => }/ui/scroll_behaviour.dart | 0 lib/{core => }/ui/shape.dart | 0 lib/{core => }/ui/shimmer.dart | 0 lib/{core => }/ui/snackbar.dart | 0 lib/{core => }/ui/snackbar/snackbar.dart | 0 .../ui/snackbar/snackbar_error.dart | 0 lib/{core => }/ui/snackbar/snackbar_info.dart | 0 .../ui/snackbar/snackbar_success.dart | 0 lib/{core => }/ui/switch.dart | 0 lib/{core => }/ui/table.dart | 0 lib/{core => }/ui/table/table_card.dart | 0 lib/{core => }/ui/table/table_content.dart | 0 lib/{core => }/ui/text.dart | 0 lib/{core => }/ui/text_span.dart | 0 lib/{core => }/ui/text_style.dart | 0 lib/{core => }/ui/theme.dart | 0 lib/{core => ui}/ui.dart | 81 ++++++++++--------- lib/{core => }/ui/will_pop_scope.dart | 0 147 files changed, 219 insertions(+), 196 deletions(-) delete mode 100644 lib/core/system/networking/networking.dart delete mode 100644 lib/core/system/networking/platform/networking_html.dart delete mode 100644 lib/core/system/networking/platform/networking_stub.dart delete mode 100644 lib/core/system/quick_actions.dart rename lib/system/{build => }/environment.dart (92%) rename lib/{core => }/system/filesystem/file.dart (100%) rename lib/{core => }/system/filesystem/filesystem.dart (100%) rename lib/{core => }/system/filesystem/platform/filesystem_html.dart (100%) rename lib/{core => }/system/filesystem/platform/filesystem_io.dart (98%) rename lib/{core => }/system/filesystem/platform/filesystem_stub.dart (100%) rename lib/system/{build => }/flavor.dart (98%) rename lib/{core => }/system/localization.dart (86%) create mode 100644 lib/system/network/network.dart create mode 100644 lib/system/network/platform/network_html.dart rename lib/{core/system/networking/platform/networking_io.dart => system/network/platform/network_io.dart} (81%) create mode 100644 lib/system/network/platform/network_stub.dart rename lib/{core => }/system/platform.dart (100%) create mode 100644 lib/system/quick_actions/platform/quick_actions_html.dart create mode 100644 lib/system/quick_actions/platform/quick_actions_io.dart create mode 100644 lib/system/quick_actions/platform/quick_actions_stub.dart create mode 100644 lib/system/quick_actions/quick_actions.dart rename lib/{core => }/system/window_manager/platform/window_manager_html.dart (100%) rename lib/{core => }/system/window_manager/platform/window_manager_io.dart (100%) rename lib/{core => }/system/window_manager/platform/window_manager_stub.dart (100%) rename lib/{core => }/system/window_manager/window_manager.dart (100%) rename lib/{core => }/ui/appbar.dart (100%) rename lib/{core => }/ui/banner.dart (100%) rename lib/{core => }/ui/block.dart (100%) rename lib/{core => }/ui/block/block.dart (100%) rename lib/{core => }/ui/block/grid_block.dart (100%) rename lib/{core => }/ui/bottom_bar.dart (100%) rename lib/{core => }/ui/bottom_bar/action_bar.dart (100%) rename lib/{core => }/ui/bottom_bar/action_bar_card.dart (100%) rename lib/{core => }/ui/bottom_bar/badge.dart (100%) rename lib/{core => }/ui/bottom_bar/navigation_bar.dart (100%) rename lib/{core => }/ui/bottom_modal_sheet.dart (100%) rename lib/{core => }/ui/button.dart (100%) rename lib/{core => }/ui/card.dart (100%) rename lib/{core => }/ui/colors.dart (100%) rename lib/{core => }/ui/containers.dart (100%) rename lib/{core => }/ui/containers/button_container.dart (100%) rename lib/{core => }/ui/controllers.dart (100%) rename lib/{core => }/ui/controllers/page_controller.dart (100%) rename lib/{core => }/ui/deprecated.dart (100%) rename lib/{core => }/ui/dialog.dart (100%) rename lib/{core => }/ui/divider.dart (100%) rename lib/{core => }/ui/drawer.dart (100%) rename lib/{core => }/ui/drawer/drawer.dart (100%) rename lib/{core => }/ui/drawer/drawer_header.dart (100%) rename lib/{core => }/ui/floating_action_button.dart (100%) rename lib/{core => }/ui/floating_action_button/floating_action_button_animated.dart (100%) rename lib/{core => }/ui/floating_action_button/floating_action_button_extended.dart (100%) rename lib/{core => }/ui/grid_view.dart (100%) rename lib/{core => }/ui/grid_view/grid_view_builder.dart (100%) rename lib/{core => }/ui/header.dart (100%) rename lib/{core => }/ui/highlighted_node.dart (100%) rename lib/{core => }/ui/icons.dart (100%) rename lib/{core => }/ui/icons/icon.dart (100%) rename lib/{core => }/ui/icons/icon_brands.dart (100%) rename lib/{core => }/ui/icons/icon_button.dart (100%) rename lib/{core => }/ui/images.dart (100%) rename lib/{core => }/ui/images/network_image.dart (100%) rename lib/{core => }/ui/images/network_image_provider/network_image_provider.dart (100%) rename lib/{core => }/ui/images/network_image_provider/platform/network_image_provider_html.dart (100%) rename lib/{core => }/ui/images/network_image_provider/platform/network_image_provider_io.dart (93%) rename lib/{core => }/ui/images/network_image_provider/platform/network_image_provider_stub.dart (100%) rename lib/{core => }/ui/input_bar.dart (100%) rename lib/{core => }/ui/linear_indicator.dart (100%) rename lib/{core => }/ui/list_tile.dart (100%) rename lib/{core => }/ui/list_tile/expandable_list_tile.dart (100%) rename lib/{core => }/ui/list_tile/list_tile.dart (100%) rename lib/{core => }/ui/list_view.dart (100%) rename lib/{core => }/ui/list_view/flutter_reorderable_list_view.dart (100%) rename lib/{core => }/ui/list_view/list_view.dart (100%) rename lib/{core => }/ui/list_view/list_view_builder.dart (100%) rename lib/{core => }/ui/list_view/list_view_modal.dart (100%) rename lib/{core => }/ui/list_view/list_view_modal_builder.dart (100%) rename lib/{core => }/ui/list_view/paged_list_view.dart (100%) rename lib/{core => }/ui/list_view/reorderable_list_view.dart (100%) rename lib/{core => }/ui/list_view/reorderable_list_view_builder.dart (100%) rename lib/{core => }/ui/list_view/reorderable_list_view_dragger.dart (100%) rename lib/{core => }/ui/loader.dart (100%) rename lib/{core => }/ui/message.dart (100%) rename lib/{core => ui}/mixins.dart (100%) rename lib/{core => ui}/mixins/load_callback.dart (100%) rename lib/{core => ui}/mixins/scroll_controller.dart (100%) rename lib/{core => }/ui/page_view.dart (100%) rename lib/{core => }/ui/popup_menu_button.dart (100%) rename lib/{core => }/ui/refresh_indicator.dart (100%) rename lib/{core => }/ui/scaffold.dart (100%) rename lib/{core => }/ui/scroll_behaviour.dart (100%) rename lib/{core => }/ui/shape.dart (100%) rename lib/{core => }/ui/shimmer.dart (100%) rename lib/{core => }/ui/snackbar.dart (100%) rename lib/{core => }/ui/snackbar/snackbar.dart (100%) rename lib/{core => }/ui/snackbar/snackbar_error.dart (100%) rename lib/{core => }/ui/snackbar/snackbar_info.dart (100%) rename lib/{core => }/ui/snackbar/snackbar_success.dart (100%) rename lib/{core => }/ui/switch.dart (100%) rename lib/{core => }/ui/table.dart (100%) rename lib/{core => }/ui/table/table_card.dart (100%) rename lib/{core => }/ui/table/table_content.dart (100%) rename lib/{core => }/ui/text.dart (100%) rename lib/{core => }/ui/text_span.dart (100%) rename lib/{core => }/ui/text_style.dart (100%) rename lib/{core => }/ui/theme.dart (100%) rename lib/{core => ui}/ui.dart (73%) rename lib/{core => }/ui/will_pop_scope.dart (100%) diff --git a/build.yaml b/build.yaml index dacca006..1ec93871 100644 --- a/build.yaml +++ b/build.yaml @@ -12,7 +12,7 @@ targets: exclude: - lib include: - - lib/system/build/environment.dart + - lib/system/environment.dart # Hive hive_generator: enabled: true diff --git a/lib/core.dart b/lib/core.dart index ba793fb5..543ea577 100644 --- a/lib/core.dart +++ b/lib/core.dart @@ -4,7 +4,6 @@ export 'core/database.dart'; export 'core/dialogs.dart'; export 'core/extensions.dart'; export 'core/firebase.dart'; -export 'core/mixins.dart'; export 'core/models.dart'; export 'core/modules.dart'; export 'core/pages.dart'; @@ -12,9 +11,9 @@ export 'core/router.dart'; export 'core/services.dart'; export 'core/state.dart'; export 'core/system.dart'; -export 'core/ui.dart'; export 'core/utilities.dart'; +export 'ui/ui.dart'; export 'vendor.dart' hide StreamProvider, diff --git a/lib/core/cache/image_cache/platform/image_cache_io.dart b/lib/core/cache/image_cache/platform/image_cache_io.dart index d67aa3d6..40ad6194 100644 --- a/lib/core/cache/image_cache/platform/image_cache_io.dart +++ b/lib/core/cache/image_cache/platform/image_cache_io.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_cache_manager/flutter_cache_manager.dart'; -import '../../../system/platform.dart'; +import '../../../../system/platform.dart'; import '../image_cache.dart'; bool isPlatformSupported() { diff --git a/lib/core/database/database.dart b/lib/core/database/database.dart index df5bf7c3..006d927c 100644 --- a/lib/core/database/database.dart +++ b/lib/core/database/database.dart @@ -1,6 +1,6 @@ import 'package:lunasea/core.dart'; -import '../system/platform.dart'; +import '../../system/platform.dart'; class Database { static const String _DATABASE_LEGACY_PATH = 'database'; diff --git a/lib/core/firebase/core.dart b/lib/core/firebase/core.dart index 97c96395..eaaf964f 100644 --- a/lib/core/firebase/core.dart +++ b/lib/core/firebase/core.dart @@ -1,6 +1,6 @@ import 'package:firebase_core/firebase_core.dart'; import '../../firebase_options.dart'; -import '../system/platform.dart'; +import '../../system/platform.dart'; class LunaFirebase { static bool get isSupported { diff --git a/lib/core/firebase/messaging.dart b/lib/core/firebase/messaging.dart index 619e7ab6..4e246d08 100644 --- a/lib/core/firebase/messaging.dart +++ b/lib/core/firebase/messaging.dart @@ -1,7 +1,7 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:lunasea/core.dart'; -import '../system/platform.dart'; +import '../../system/platform.dart'; class LunaFirebaseMessaging { static const _VAPID_KEY = diff --git a/lib/core/models/logs/log_type.dart b/lib/core/models/logs/log_type.dart index c750ce1b..fb683783 100644 --- a/lib/core/models/logs/log_type.dart +++ b/lib/core/models/logs/log_type.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; -import '../../../system/build/environment.dart'; -import '../../../system/build/flavor.dart'; +import '../../../system/environment.dart'; +import '../../../system/flavor.dart'; part 'log_type.g.dart'; diff --git a/lib/core/modules.dart b/lib/core/modules.dart index 4a6db4d3..e791f034 100644 --- a/lib/core/modules.dart +++ b/lib/core/modules.dart @@ -18,8 +18,8 @@ import '../modules/dashboard/core/database.dart'; import '../modules/dashboard/core/state.dart' as dashboard_state; import '../modules/dashboard/routes/dashboard/route.dart' as dashboard_home; import '../modules/wake_on_lan/api/wake_on_lan.dart'; -import '../system/build/environment.dart'; -import '../system/build/flavor.dart'; +import '../system/environment.dart'; +import '../system/flavor.dart'; part 'modules.g.dart'; @@ -542,7 +542,7 @@ extension LunaModuleExtension on LunaModule { } /// Return the [ShortcutItem] for the module. - ShortcutItem? get shortcutItem { + ShortcutItem get shortcutItem { switch (this) { case LunaModule.DASHBOARD: return ShortcutItem(type: key, localizedTitle: name); @@ -565,7 +565,7 @@ extension LunaModuleExtension on LunaModule { case LunaModule.OVERSEERR: return ShortcutItem(type: key, localizedTitle: name); case LunaModule.WAKE_ON_LAN: - return null; + throw Exception('WAKE_ON_LAN does not have a shortcut item'); case LunaModule.EXTERNAL_MODULES: return ShortcutItem(type: key, localizedTitle: name); } diff --git a/lib/core/system.dart b/lib/core/system.dart index e78167d9..d9317201 100644 --- a/lib/core/system.dart +++ b/lib/core/system.dart @@ -1,5 +1,3 @@ export 'system/configuration.dart'; export 'system/in_app_purchases.dart'; -export 'system/localization.dart'; export 'system/profile.dart'; -export 'system/quick_actions.dart'; diff --git a/lib/core/system/in_app_purchases.dart b/lib/core/system/in_app_purchases.dart index 80cb8839..cb922e83 100644 --- a/lib/core/system/in_app_purchases.dart +++ b/lib/core/system/in_app_purchases.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:in_app_purchase/in_app_purchase.dart'; import 'package:lunasea/core.dart'; -import 'platform.dart'; +import '../../system/platform.dart'; extension ProductDetailsExtension on ProductDetails { IconData get icon { diff --git a/lib/core/system/networking/networking.dart b/lib/core/system/networking/networking.dart deleted file mode 100644 index 379ccdee..00000000 --- a/lib/core/system/networking/networking.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'platform/networking_stub.dart' - if (dart.library.io) 'platform/networking_io.dart' - if (dart.library.html) 'platform/networking_html.dart'; - -abstract class LunaNetworking { - static bool get isSupported => isPlatformSupported(); - factory LunaNetworking() => getNetworking(); - - void initialize(); -} diff --git a/lib/core/system/networking/platform/networking_html.dart b/lib/core/system/networking/platform/networking_html.dart deleted file mode 100644 index 58ed89d1..00000000 --- a/lib/core/system/networking/platform/networking_html.dart +++ /dev/null @@ -1,5 +0,0 @@ -import '../networking.dart'; - -bool isPlatformSupported() => false; -LunaNetworking getNetworking() => - throw UnsupportedError('LunaNetworking unsupported'); diff --git a/lib/core/system/networking/platform/networking_stub.dart b/lib/core/system/networking/platform/networking_stub.dart deleted file mode 100644 index 58ed89d1..00000000 --- a/lib/core/system/networking/platform/networking_stub.dart +++ /dev/null @@ -1,5 +0,0 @@ -import '../networking.dart'; - -bool isPlatformSupported() => false; -LunaNetworking getNetworking() => - throw UnsupportedError('LunaNetworking unsupported'); diff --git a/lib/core/system/quick_actions.dart b/lib/core/system/quick_actions.dart deleted file mode 100644 index 63097e5c..00000000 --- a/lib/core/system/quick_actions.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:lunasea/core.dart'; -import 'package:quick_actions/quick_actions.dart'; - -import 'platform.dart'; - -class LunaQuickActions { - static const QuickActions _quickActions = QuickActions(); - - static bool get isPlatformCompatible => LunaPlatform().isMobile; - - /// Initialize the quick actions by setting the action handler. - /// - /// Required before the handler can actually receive any intents. - void initialize() { - if (isPlatformCompatible) _quickActions.initialize(_handler); - setShortcutItems(); - } - - /// Sets the shortcut items by checking the database and enabling the respective action if enabled. - void setShortcutItems() { - if (isPlatformCompatible) - _quickActions.setShortcutItems([ - if (LunaDatabaseValue.QUICK_ACTIONS_TAUTULLI.data) - LunaModule.TAUTULLI.shortcutItem!, - if (LunaDatabaseValue.QUICK_ACTIONS_SONARR.data) - LunaModule.SONARR.shortcutItem!, - if (LunaDatabaseValue.QUICK_ACTIONS_SEARCH.data) - LunaModule.SEARCH.shortcutItem!, - if (LunaDatabaseValue.QUICK_ACTIONS_SABNZBD.data) - LunaModule.SABNZBD.shortcutItem!, - if (LunaDatabaseValue.QUICK_ACTIONS_RADARR.data) - LunaModule.RADARR.shortcutItem!, - if (LunaDatabaseValue.QUICK_ACTIONS_OVERSEERR.data) - LunaModule.OVERSEERR.shortcutItem!, - if (LunaDatabaseValue.QUICK_ACTIONS_NZBGET.data) - LunaModule.NZBGET.shortcutItem!, - if (LunaDatabaseValue.QUICK_ACTIONS_LIDARR.data) - LunaModule.LIDARR.shortcutItem!, - LunaModule.SETTINGS.shortcutItem!, - ]); - } - - /// The actual shortcut command handler - void _handler(String action) => LunaModule.LIDARR.fromKey(action)?.launch(); -} diff --git a/lib/core/utilities/changelog.dart b/lib/core/utilities/changelog.dart index 22fcb3a4..1cd9713f 100644 --- a/lib/core/utilities/changelog.dart +++ b/lib/core/utilities/changelog.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; -import '../../system/build/environment.dart'; -import '../../system/build/flavor.dart'; +import '../../system/environment.dart'; +import '../../system/flavor.dart'; class LunaChangelogSheet extends LunaBottomModalSheet { late _Changelog _changelog; diff --git a/lib/main.dart b/lib/main.dart index d6b25cd0..c7976bef 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,9 +6,11 @@ import 'package:flutter/scheduler.dart'; import 'package:lunasea/core.dart'; import 'core/cache/image_cache/image_cache.dart'; -import 'core/system/networking/networking.dart'; -import 'core/system/window_manager/window_manager.dart'; -import 'core/system/platform.dart'; +import 'system/localization.dart'; +import 'system/network/network.dart'; +import 'system/quick_actions/quick_actions.dart'; +import 'system/window_manager/window_manager.dart'; +import 'system/platform.dart'; import 'modules/dashboard/routes/dashboard/route.dart' show HomeRouter; /// LunaSea Entry Point: Initialize & Run Application @@ -24,7 +26,7 @@ Future main() async { LunaLogger().initialize(); LunaTheme().initialize(); if (LunaWindowManager.isSupported) await LunaWindowManager().initialize(); - if (LunaNetworking.isSupported) LunaNetworking().initialize(); + if (LunaNetwork.isSupported) LunaNetwork().initialize(); if (LunaImageCache.isSupported) LunaImageCache().initialize(); LunaRouter().initialize(); await LunaInAppPurchases().initialize(); @@ -43,7 +45,6 @@ class LunaBIOS extends StatelessWidget { @override Widget build(BuildContext context) { - LunaLocalization localization = LunaLocalization(); LunaTheme theme = LunaTheme(); LunaRouter router = LunaRouter(); @@ -51,10 +52,10 @@ class LunaBIOS extends StatelessWidget { child: DevicePreview( enabled: kDebugMode && LunaPlatform().isDesktop, builder: (context) => EasyLocalization( - supportedLocales: localization.supportedLocales as List, - path: localization.fileDirectory, - fallbackLocale: localization.fallbackLocale, - startLocale: localization.fallbackLocale, + supportedLocales: LunaLocalization().supportedLocales(), + path: LunaLocalization.fileDirectory, + fallbackLocale: LunaLocalization.fallbackLocale, + startLocale: LunaLocalization.fallbackLocale, useFallbackTranslations: true, child: LunaState.providers( child: ValueListenableBuilder( @@ -122,7 +123,7 @@ class _State extends State { tag ??= LunaLanguage.ENGLISH.languageTag; Intl.defaultLocale = tag; - LunaQuickActions().initialize(); + if (LunaQuickActions.isSupported) LunaQuickActions().initialize(); LunaChangelogSheet().show( context: LunaState.navigatorKey.currentContext!, checkBuildVersion: true, diff --git a/lib/modules/dashboard/core/api/api.dart b/lib/modules/dashboard/core/api/api.dart index 1766de72..5969ad8c 100644 --- a/lib/modules/dashboard/core/api/api.dart +++ b/lib/modules/dashboard/core/api/api.dart @@ -1,6 +1,6 @@ import '../../../../core/models/configuration/profile.dart'; import '../../../../core/extensions.dart'; -import '../../../../core/ui.dart'; +import '../../../../ui/ui.dart'; import '../../../../vendor.dart'; import '../database.dart'; import 'data/abstract.dart'; diff --git a/lib/modules/dashboard/core/api/data/lidarr.dart b/lib/modules/dashboard/core/api/data/lidarr.dart index 3bb83826..1733f86c 100644 --- a/lib/modules/dashboard/core/api/data/lidarr.dart +++ b/lib/modules/dashboard/core/api/data/lidarr.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import '../../../../../core/system/profile.dart'; -import '../../../../../core/ui.dart'; +import '../../../../../ui/ui.dart'; import '../../../../lidarr/core/api/api.dart'; import '../../../../lidarr/routes/details_artist.dart'; import '../../../../lidarr/routes/search_results.dart'; diff --git a/lib/modules/dashboard/core/api/data/radarr.dart b/lib/modules/dashboard/core/api/data/radarr.dart index 2308a0e6..8d3a1cac 100644 --- a/lib/modules/dashboard/core/api/data/radarr.dart +++ b/lib/modules/dashboard/core/api/data/radarr.dart @@ -3,7 +3,7 @@ import 'package:provider/provider.dart'; import '../../../../../core/system/profile.dart'; import '../../../../../core/extensions.dart'; -import '../../../../../core/ui.dart'; +import '../../../../../ui/ui.dart'; import '../../../../../vendor.dart'; import '../../../../radarr/core/api_helper.dart'; import '../../../../radarr/core/state.dart'; diff --git a/lib/modules/dashboard/core/api/data/sonarr.dart b/lib/modules/dashboard/core/api/data/sonarr.dart index 5343c5f3..4e110506 100644 --- a/lib/modules/dashboard/core/api/data/sonarr.dart +++ b/lib/modules/dashboard/core/api/data/sonarr.dart @@ -4,7 +4,7 @@ import 'package:provider/provider.dart'; import '../../../../../core/database/luna_database.dart'; import '../../../../../core/system/profile.dart'; import '../../../../../core/extensions.dart'; -import '../../../../../core/ui.dart'; +import '../../../../../ui/ui.dart'; import '../../../../../core/utilities/logger.dart'; import '../../../../../vendor.dart'; import '../../../../sonarr/core/state.dart'; diff --git a/lib/modules/dashboard/core/dialogs.dart b/lib/modules/dashboard/core/dialogs.dart index 34aa7b2b..d4386ba4 100644 --- a/lib/modules/dashboard/core/dialogs.dart +++ b/lib/modules/dashboard/core/dialogs.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../../../core/ui.dart'; +import '../../../ui/ui.dart'; import '../../../vendor.dart'; import '../routes/dashboard/widgets/navigation_bar.dart'; import 'database.dart'; diff --git a/lib/modules/dashboard/routes/dashboard/pages/calendar.dart b/lib/modules/dashboard/routes/dashboard/pages/calendar.dart index 3881e5a6..eb27a5e1 100644 --- a/lib/modules/dashboard/routes/dashboard/pages/calendar.dart +++ b/lib/modules/dashboard/routes/dashboard/pages/calendar.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../../../../../core/mixins/load_callback.dart'; import '../../../../../core/extensions.dart'; -import '../../../../../core/ui.dart'; +import '../../../../../ui/ui.dart'; import '../../../../../core/utilities/logger.dart'; import '../../../../../vendor.dart'; import '../../../core/adapters/calendar_starting_type.dart'; diff --git a/lib/modules/dashboard/routes/dashboard/pages/modules.dart b/lib/modules/dashboard/routes/dashboard/pages/modules.dart index 7a0f282a..b2a5a5c7 100644 --- a/lib/modules/dashboard/routes/dashboard/pages/modules.dart +++ b/lib/modules/dashboard/routes/dashboard/pages/modules.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import '../../../../../../core/database/luna_database.dart'; import '../../../../../../core/modules.dart'; import '../../../../../../core/system/profile.dart'; -import '../../../../../../core/ui.dart'; +import '../../../../../../ui/ui.dart'; import '../../../../wake_on_lan/api/wake_on_lan.dart'; import '../widgets/navigation_bar.dart'; diff --git a/lib/modules/dashboard/routes/dashboard/route.dart b/lib/modules/dashboard/routes/dashboard/route.dart index 739968c0..995e1375 100644 --- a/lib/modules/dashboard/routes/dashboard/route.dart +++ b/lib/modules/dashboard/routes/dashboard/route.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import '../../../../core/database/luna_database.dart'; import '../../../../core/modules.dart'; -import '../../../../core/ui.dart'; +import '../../../../ui/ui.dart'; import '../../../../vendor.dart'; import '../../core/database.dart'; import '../routes.dart'; diff --git a/lib/modules/dashboard/routes/dashboard/widgets/calendar_view.dart b/lib/modules/dashboard/routes/dashboard/widgets/calendar_view.dart index 97b7c741..aafb4521 100644 --- a/lib/modules/dashboard/routes/dashboard/widgets/calendar_view.dart +++ b/lib/modules/dashboard/routes/dashboard/widgets/calendar_view.dart @@ -4,7 +4,7 @@ import 'package:provider/provider.dart'; import '../../../../../core/database/database.dart'; import '../../../../../core/extensions.dart'; -import '../../../../../core/ui.dart'; +import '../../../../../ui/ui.dart'; import '../../../../../vendor.dart'; import '../../../core/adapters/calendar_starting_day.dart'; import '../../../core/adapters/calendar_starting_size.dart'; diff --git a/lib/modules/dashboard/routes/dashboard/widgets/content_block.dart b/lib/modules/dashboard/routes/dashboard/widgets/content_block.dart index 74005699..a5708fa4 100644 --- a/lib/modules/dashboard/routes/dashboard/widgets/content_block.dart +++ b/lib/modules/dashboard/routes/dashboard/widgets/content_block.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import '../../../../../core/system/profile.dart'; -import '../../../../../core/ui.dart'; +import '../../../../../ui/ui.dart'; import '../../../core/api/data/abstract.dart'; import '../../../core/api/data/lidarr.dart'; import '../../../core/api/data/radarr.dart'; diff --git a/lib/modules/dashboard/routes/dashboard/widgets/schedule_view.dart b/lib/modules/dashboard/routes/dashboard/widgets/schedule_view.dart index 011e379b..0cd9f87a 100644 --- a/lib/modules/dashboard/routes/dashboard/widgets/schedule_view.dart +++ b/lib/modules/dashboard/routes/dashboard/widgets/schedule_view.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../../../../../core/extensions.dart'; -import '../../../../../core/ui.dart'; +import '../../../../../ui/ui.dart'; import '../../../core/api/data/abstract.dart'; import '../../../core/database.dart'; import '../../../core/state.dart'; diff --git a/lib/modules/dashboard/routes/dashboard/widgets/switch_view_action.dart b/lib/modules/dashboard/routes/dashboard/widgets/switch_view_action.dart index ce4dfda9..9b09cc9a 100644 --- a/lib/modules/dashboard/routes/dashboard/widgets/switch_view_action.dart +++ b/lib/modules/dashboard/routes/dashboard/widgets/switch_view_action.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../../../../../core/mixins/load_callback.dart'; -import '../../../../../core/ui.dart'; +import '../../../../../ui/ui.dart'; import '../../../../../vendor.dart'; import '../../../core/adapters/calendar_starting_type.dart'; import '../../../core/state.dart'; diff --git a/lib/modules/nzbget/routes/nzbget.dart b/lib/modules/nzbget/routes/nzbget.dart index 314df6ed..75c99bbb 100644 --- a/lib/modules/nzbget/routes/nzbget.dart +++ b/lib/modules/nzbget/routes/nzbget.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/nzbget.dart'; -import '../../../core/system/filesystem/file.dart'; -import '../../../core/system/filesystem/filesystem.dart'; +import '../../../system/filesystem/file.dart'; +import '../../../system/filesystem/filesystem.dart'; class NZBGet extends StatefulWidget { static const ROUTE_NAME = '/nzbget'; diff --git a/lib/modules/sabnzbd/routes/sabnzbd.dart b/lib/modules/sabnzbd/routes/sabnzbd.dart index 2f2763cb..be7f350b 100644 --- a/lib/modules/sabnzbd/routes/sabnzbd.dart +++ b/lib/modules/sabnzbd/routes/sabnzbd.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/sabnzbd.dart'; -import '../../../core/system/filesystem/file.dart'; -import '../../../core/system/filesystem/filesystem.dart'; +import '../../../system/filesystem/file.dart'; +import '../../../system/filesystem/filesystem.dart'; class SABnzbd extends StatefulWidget { static const ROUTE_NAME = '/sabnzbd'; diff --git a/lib/modules/search/core/types/download_type.dart b/lib/modules/search/core/types/download_type.dart index 783fcb1a..d56c038c 100644 --- a/lib/modules/search/core/types/download_type.dart +++ b/lib/modules/search/core/types/download_type.dart @@ -4,7 +4,7 @@ import 'package:lunasea/modules/nzbget.dart'; import 'package:lunasea/modules/sabnzbd.dart'; import 'package:lunasea/modules/search.dart'; -import '../../../../core/system/filesystem/filesystem.dart'; +import '../../../../system/filesystem/filesystem.dart'; enum SearchDownloadType { NZBGET, diff --git a/lib/modules/settings/core/dialogs.dart b/lib/modules/settings/core/dialogs.dart index 58465782..97a18898 100644 --- a/lib/modules/settings/core/dialogs.dart +++ b/lib/modules/settings/core/dialogs.dart @@ -7,8 +7,8 @@ import 'package:wake_on_lan/wake_on_lan.dart'; import '../../../core/database/luna_database.dart'; import '../../../core/firebase/types/backup_document.dart'; import '../../../core/models/types/browser.dart'; -import '../../../core/system/localization.dart'; -import '../../../core/ui.dart'; +import '../../../system/localization.dart'; +import '../../../ui/ui.dart'; import '../../dashboard/core/adapters/calendar_starting_day.dart'; import '../../dashboard/core/adapters/calendar_starting_size.dart'; import '../../dashboard/core/adapters/calendar_starting_type.dart'; @@ -892,7 +892,7 @@ class SettingsDialogs { Future> changeLanguage( BuildContext context, ) async { - List languages = LunaLocalization().supportedLanguages; + List languages = LunaLocalization().supportedLanguages(); bool _flag = false; LunaLanguage? _language; diff --git a/lib/modules/settings/routes/configuration/route.dart b/lib/modules/settings/routes/configuration/route.dart index 3cc06c4b..27bee5e3 100644 --- a/lib/modules/settings/routes/configuration/route.dart +++ b/lib/modules/settings/routes/configuration/route.dart @@ -2,8 +2,9 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/settings.dart'; -import '../../../../core/system/networking/networking.dart'; -import '../../../../core/system/platform.dart'; +import '../../../../system/network/network.dart'; +import '../../../../system/platform.dart'; +import '../../../../system/quick_actions/quick_actions.dart'; class SettingsConfigurationRouter extends SettingsPageRouter { SettingsConfigurationRouter() : super('/settings/configuration'); @@ -81,7 +82,7 @@ class _State extends State<_Widget> with LunaScrollControllerMixin { onTap: () async => SettingsConfigurationLocalizationRouter().navigateTo(context), ), - if (LunaNetworking.isSupported) + if (LunaNetwork.isSupported) LunaBlock( title: 'settings.Network'.tr(), body: [TextSpan(text: 'settings.NetworkDescription'.tr())], @@ -105,7 +106,7 @@ class _State extends State<_Widget> with LunaScrollControllerMixin { ); }, ), - if (LunaQuickActions.isPlatformCompatible) + if (LunaQuickActions.isSupported) LunaBlock( title: 'settings.QuickActions'.tr(), body: [TextSpan(text: 'settings.QuickActionsDescription'.tr())], diff --git a/lib/modules/settings/routes/configuration_dashboard/pages/calendar_settings.dart b/lib/modules/settings/routes/configuration_dashboard/pages/calendar_settings.dart index 876e7623..b1db6fcc 100644 --- a/lib/modules/settings/routes/configuration_dashboard/pages/calendar_settings.dart +++ b/lib/modules/settings/routes/configuration_dashboard/pages/calendar_settings.dart @@ -2,9 +2,8 @@ import 'package:fluro/fluro.dart'; import 'package:flutter/material.dart'; import 'package:tuple/tuple.dart'; -import '../../../../../core/mixins/scroll_controller.dart'; import '../../../../../core/modules.dart'; -import '../../../../../core/ui.dart'; +import '../../../../../ui/ui.dart'; import '../../../../dashboard/core/adapters/calendar_starting_day.dart'; import '../../../../dashboard/core/adapters/calendar_starting_size.dart'; import '../../../../dashboard/core/adapters/calendar_starting_type.dart'; diff --git a/lib/modules/settings/routes/configuration_localization/route.dart b/lib/modules/settings/routes/configuration_localization/route.dart index dfcd1a73..26f888a4 100644 --- a/lib/modules/settings/routes/configuration_localization/route.dart +++ b/lib/modules/settings/routes/configuration_localization/route.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/settings.dart'; +import '../../../../system/localization.dart'; + class SettingsConfigurationLocalizationRouter extends SettingsPageRouter { SettingsConfigurationLocalizationRouter() : super('/settings/configuration/localization'); diff --git a/lib/modules/settings/routes/configuration_network/route.dart b/lib/modules/settings/routes/configuration_network/route.dart index 7bb6605b..b3227c37 100644 --- a/lib/modules/settings/routes/configuration_network/route.dart +++ b/lib/modules/settings/routes/configuration_network/route.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/settings.dart'; -import '../../../../core/system/networking/networking.dart'; +import '../../../../system/network/network.dart'; class SettingsConfigurationNetworkRouter extends SettingsPageRouter { SettingsConfigurationNetworkRouter() @@ -62,7 +62,7 @@ class _State extends State<_Widget> with LunaScrollControllerMixin { value: _db.data, onChanged: (data) { _db.put(data); - if (LunaNetworking.isSupported) LunaNetworking().initialize(); + if (LunaNetwork.isSupported) LunaNetwork().initialize(); }, ), ), diff --git a/lib/modules/settings/routes/configuration_quickactions/route.dart b/lib/modules/settings/routes/configuration_quickactions/route.dart index f5e9d644..af48755a 100644 --- a/lib/modules/settings/routes/configuration_quickactions/route.dart +++ b/lib/modules/settings/routes/configuration_quickactions/route.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/settings.dart'; +import '../../../../system/quick_actions/quick_actions.dart'; + class SettingsConfigurationQuickActionsRouter extends SettingsPageRouter { SettingsConfigurationQuickActionsRouter() : super('/settings/configuration/quickactions'); @@ -90,7 +92,8 @@ class _State extends State<_Widget> with LunaScrollControllerMixin { value: action.data, onChanged: (value) { action.put(value); - LunaQuickActions().setShortcutItems(); + if (LunaQuickActions.isSupported) + LunaQuickActions().setActionItems(); }), ), ); diff --git a/lib/modules/settings/routes/settings/route.dart b/lib/modules/settings/routes/settings/route.dart index 4fb2f7df..3a3529f5 100644 --- a/lib/modules/settings/routes/settings/route.dart +++ b/lib/modules/settings/routes/settings/route.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/settings.dart'; -import '../../../../system/build/environment.dart'; -import '../../../../system/build/flavor.dart'; +import '../../../../system/environment.dart'; +import '../../../../system/flavor.dart'; class SettingsHomeRouter extends SettingsPageRouter { SettingsHomeRouter() : super('/settings'); diff --git a/lib/modules/settings/routes/system/route.dart b/lib/modules/settings/routes/system/route.dart index 895d5f05..e4e202ef 100644 --- a/lib/modules/settings/routes/system/route.dart +++ b/lib/modules/settings/routes/system/route.dart @@ -3,8 +3,8 @@ import 'package:lunasea/core.dart'; import 'package:lunasea/modules/settings.dart'; import '../../../../core/cache/image_cache/image_cache.dart'; -import '../../../../system/build/environment.dart'; -import '../../../../system/build/flavor.dart'; +import '../../../../system/environment.dart'; +import '../../../../system/flavor.dart'; class SettingsSystemRouter extends SettingsPageRouter { SettingsSystemRouter() : super('/settings/system'); diff --git a/lib/modules/settings/routes/system/widgets/backup_tile.dart b/lib/modules/settings/routes/system/widgets/backup_tile.dart index 97304c55..66f62b4d 100644 --- a/lib/modules/settings/routes/system/widgets/backup_tile.dart +++ b/lib/modules/settings/routes/system/widgets/backup_tile.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/settings.dart'; -import '../../../../../core/system/filesystem/filesystem.dart'; +import '../../../../../system/filesystem/filesystem.dart'; class SettingsSystemBackupRestoreBackupTile extends StatelessWidget { const SettingsSystemBackupRestoreBackupTile({ diff --git a/lib/modules/settings/routes/system/widgets/restore_tile.dart b/lib/modules/settings/routes/system/widgets/restore_tile.dart index 74f1210c..d554b7ee 100644 --- a/lib/modules/settings/routes/system/widgets/restore_tile.dart +++ b/lib/modules/settings/routes/system/widgets/restore_tile.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/settings.dart'; -import '../../../../../core/system/filesystem/file.dart'; -import '../../../../../core/system/filesystem/filesystem.dart'; +import '../../../../../system/filesystem/file.dart'; +import '../../../../../system/filesystem/filesystem.dart'; class SettingsSystemBackupRestoreRestoreTile extends StatelessWidget { const SettingsSystemBackupRestoreRestoreTile({ diff --git a/lib/modules/settings/routes/system_logs/route.dart b/lib/modules/settings/routes/system_logs/route.dart index 785b2ffe..3967bda1 100644 --- a/lib/modules/settings/routes/system_logs/route.dart +++ b/lib/modules/settings/routes/system_logs/route.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/settings.dart'; -import '../../../../core/system/filesystem/filesystem.dart'; +import '../../../../system/filesystem/filesystem.dart'; class SettingsSystemLogsRouter extends SettingsPageRouter { SettingsSystemLogsRouter() : super('/settings/logs'); diff --git a/lib/modules/wake_on_lan/api/platform/wake_on_lan_io.dart b/lib/modules/wake_on_lan/api/platform/wake_on_lan_io.dart index d74b5128..5029aa78 100644 --- a/lib/modules/wake_on_lan/api/platform/wake_on_lan_io.dart +++ b/lib/modules/wake_on_lan/api/platform/wake_on_lan_io.dart @@ -2,7 +2,7 @@ import 'package:wake_on_lan/wake_on_lan.dart'; import '../../../../core/models/configuration/profile.dart'; import '../../../../core/system/profile.dart'; -import '../../../../core/ui.dart'; +import '../../../../ui/ui.dart'; import '../../../../core/utilities/logger.dart'; import '../wake_on_lan.dart'; diff --git a/lib/system/build/environment.dart b/lib/system/environment.dart similarity index 92% rename from lib/system/build/environment.dart rename to lib/system/environment.dart index ffa747e9..0b6386d4 100644 --- a/lib/system/build/environment.dart +++ b/lib/system/environment.dart @@ -21,7 +21,7 @@ class LunaEnvironment { } /// Returns if the given flavor is "lower" than the given environment. - /// For example, `alpha` is lower than `beta` but is not lower than `develop`. + /// For example, `beta` is lower than `candidate` but is not lower than `edge`. bool isFlavorSupported(LunaFlavor env) { LunaFlavor _flavor = LunaFlavor.EDGE.from(flavor); if (_flavor == env) return true; diff --git a/lib/core/system/filesystem/file.dart b/lib/system/filesystem/file.dart similarity index 100% rename from lib/core/system/filesystem/file.dart rename to lib/system/filesystem/file.dart diff --git a/lib/core/system/filesystem/filesystem.dart b/lib/system/filesystem/filesystem.dart similarity index 100% rename from lib/core/system/filesystem/filesystem.dart rename to lib/system/filesystem/filesystem.dart diff --git a/lib/core/system/filesystem/platform/filesystem_html.dart b/lib/system/filesystem/platform/filesystem_html.dart similarity index 100% rename from lib/core/system/filesystem/platform/filesystem_html.dart rename to lib/system/filesystem/platform/filesystem_html.dart diff --git a/lib/core/system/filesystem/platform/filesystem_io.dart b/lib/system/filesystem/platform/filesystem_io.dart similarity index 98% rename from lib/core/system/filesystem/platform/filesystem_io.dart rename to lib/system/filesystem/platform/filesystem_io.dart index 9397d016..db21bb32 100644 --- a/lib/core/system/filesystem/platform/filesystem_io.dart +++ b/lib/system/filesystem/platform/filesystem_io.dart @@ -5,8 +5,8 @@ import 'package:flutter/foundation.dart'; import 'package:path_provider/path_provider.dart'; import 'package:share_plus/share_plus.dart'; -import '../../../ui.dart'; -import '../../../utilities/logger.dart'; +import '../../../ui/ui.dart'; +import '../../../core/utilities/logger.dart'; import '../../platform.dart'; import '../file.dart'; import '../filesystem.dart'; diff --git a/lib/core/system/filesystem/platform/filesystem_stub.dart b/lib/system/filesystem/platform/filesystem_stub.dart similarity index 100% rename from lib/core/system/filesystem/platform/filesystem_stub.dart rename to lib/system/filesystem/platform/filesystem_stub.dart diff --git a/lib/system/build/flavor.dart b/lib/system/flavor.dart similarity index 98% rename from lib/system/build/flavor.dart rename to lib/system/flavor.dart index 229f64e8..6ec34870 100644 --- a/lib/system/build/flavor.dart +++ b/lib/system/flavor.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../../core/ui.dart'; +import '../../ui/ui.dart'; const _EDGE = 'edge'; const _BETA = 'beta'; diff --git a/lib/core/system/localization.dart b/lib/system/localization.dart similarity index 86% rename from lib/core/system/localization.dart rename to lib/system/localization.dart index 95fa20f5..519b6408 100644 --- a/lib/core/system/localization.dart +++ b/lib/system/localization.dart @@ -1,24 +1,21 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; -import '../../system/build/environment.dart'; -import '../../system/build/flavor.dart'; +import 'environment.dart'; +import 'flavor.dart'; class LunaLocalization { - /// List of [LunaLanguage] values with all currently supported languages - List get supportedLanguages => - LunaLanguage.values.where((lang) => lang.enabled).toList(); + static const fileDirectory = 'assets/localization'; + static final fallbackLocale = LunaLanguage.ENGLISH.locale; - /// Returns an iterable list of [Locale] objects containing all supported & enabled locales. - Iterable get supportedLocales => - supportedLanguages.map((lang) => lang.locale).toList(); + List supportedLanguages() { + return LunaLanguage.values.where((lang) => lang.enabled).toList(); + } - Locale get fallbackLocale => LunaLanguage.ENGLISH.locale; + List supportedLocales() { + return supportedLanguages().map((lang) => lang.locale).toList(); + } - /// Directory containing all localization files - String get fileDirectory => 'assets/localization'; - - /// Initialize the localization system. Future initialize() async { await EasyLocalization.ensureInitialized(); } @@ -75,7 +72,6 @@ extension LunaLanguageExtension on LunaLanguage { switch (this) { case LunaLanguage.ENGLISH: return true; - // Keep all languages enabled in debug mode while LunaSea is being adapted for localization case LunaLanguage.FRENCH: case LunaLanguage.GERMAN: case LunaLanguage.ITALIAN: diff --git a/lib/system/network/network.dart b/lib/system/network/network.dart new file mode 100644 index 00000000..69f749cf --- /dev/null +++ b/lib/system/network/network.dart @@ -0,0 +1,10 @@ +import 'platform/network_stub.dart' + if (dart.library.io) 'platform/network_io.dart' + if (dart.library.html) 'platform/network_html.dart'; + +abstract class LunaNetwork { + static bool get isSupported => isPlatformSupported(); + factory LunaNetwork() => getNetwork(); + + void initialize(); +} diff --git a/lib/system/network/platform/network_html.dart b/lib/system/network/platform/network_html.dart new file mode 100644 index 00000000..ef8a02a1 --- /dev/null +++ b/lib/system/network/platform/network_html.dart @@ -0,0 +1,4 @@ +import '../network.dart'; + +bool isPlatformSupported() => false; +LunaNetwork getNetwork() => throw UnsupportedError('LunaNetwork unsupported'); diff --git a/lib/core/system/networking/platform/networking_io.dart b/lib/system/network/platform/network_io.dart similarity index 81% rename from lib/core/system/networking/platform/networking_io.dart rename to lib/system/network/platform/network_io.dart index 964ae57c..d01af573 100644 --- a/lib/core/system/networking/platform/networking_io.dart +++ b/lib/system/network/platform/network_io.dart @@ -1,13 +1,13 @@ import 'dart:io'; import '../../../../vendor.dart'; -import '../../../database/luna_database.dart'; -import '../networking.dart'; +import '../../../core/database/luna_database.dart'; +import '../network.dart'; bool isPlatformSupported() => true; -LunaNetworking getNetworking() => IO(); +LunaNetwork getNetwork() => IO(); -class IO extends HttpOverrides implements LunaNetworking { +class IO extends HttpOverrides implements LunaNetwork { @override void initialize() { HttpOverrides.global = IO(); diff --git a/lib/system/network/platform/network_stub.dart b/lib/system/network/platform/network_stub.dart new file mode 100644 index 00000000..ef8a02a1 --- /dev/null +++ b/lib/system/network/platform/network_stub.dart @@ -0,0 +1,4 @@ +import '../network.dart'; + +bool isPlatformSupported() => false; +LunaNetwork getNetwork() => throw UnsupportedError('LunaNetwork unsupported'); diff --git a/lib/core/system/platform.dart b/lib/system/platform.dart similarity index 100% rename from lib/core/system/platform.dart rename to lib/system/platform.dart diff --git a/lib/system/quick_actions/platform/quick_actions_html.dart b/lib/system/quick_actions/platform/quick_actions_html.dart new file mode 100644 index 00000000..2f6cca88 --- /dev/null +++ b/lib/system/quick_actions/platform/quick_actions_html.dart @@ -0,0 +1,5 @@ +import '../quick_actions.dart'; + +bool isPlatformSupported() => false; +LunaQuickActions getQuickActions() => + throw UnsupportedError('LunaQuickActions unsupported'); diff --git a/lib/system/quick_actions/platform/quick_actions_io.dart b/lib/system/quick_actions/platform/quick_actions_io.dart new file mode 100644 index 00000000..789bca91 --- /dev/null +++ b/lib/system/quick_actions/platform/quick_actions_io.dart @@ -0,0 +1,50 @@ +import 'package:quick_actions/quick_actions.dart'; + +import '../../../core/database/luna_database.dart'; +import '../../../core/modules.dart'; +import '../../platform.dart'; +import '../quick_actions.dart'; + +bool isPlatformSupported() => LunaPlatform().isMobile; +LunaQuickActions getQuickActions() { + if (isPlatformSupported()) return IO(); + throw UnsupportedError('LunaQuickActions unsupported'); +} + +class IO implements LunaQuickActions { + final QuickActions _quickActions = const QuickActions(); + + @override + Future initialize() async { + _quickActions.initialize(actionHandler); + setActionItems(); + } + + @override + void actionHandler(String action) { + LunaModule.LIDARR.fromKey(action)?.launch(); + } + + @override + void setActionItems() { + _quickActions.setShortcutItems([ + if (LunaDatabaseValue.QUICK_ACTIONS_TAUTULLI.data) + LunaModule.TAUTULLI.shortcutItem, + if (LunaDatabaseValue.QUICK_ACTIONS_SONARR.data) + LunaModule.SONARR.shortcutItem, + if (LunaDatabaseValue.QUICK_ACTIONS_SEARCH.data) + LunaModule.SEARCH.shortcutItem, + if (LunaDatabaseValue.QUICK_ACTIONS_SABNZBD.data) + LunaModule.SABNZBD.shortcutItem, + if (LunaDatabaseValue.QUICK_ACTIONS_RADARR.data) + LunaModule.RADARR.shortcutItem, + if (LunaDatabaseValue.QUICK_ACTIONS_OVERSEERR.data) + LunaModule.OVERSEERR.shortcutItem, + if (LunaDatabaseValue.QUICK_ACTIONS_NZBGET.data) + LunaModule.NZBGET.shortcutItem, + if (LunaDatabaseValue.QUICK_ACTIONS_LIDARR.data) + LunaModule.LIDARR.shortcutItem, + LunaModule.SETTINGS.shortcutItem, + ]); + } +} diff --git a/lib/system/quick_actions/platform/quick_actions_stub.dart b/lib/system/quick_actions/platform/quick_actions_stub.dart new file mode 100644 index 00000000..2f6cca88 --- /dev/null +++ b/lib/system/quick_actions/platform/quick_actions_stub.dart @@ -0,0 +1,5 @@ +import '../quick_actions.dart'; + +bool isPlatformSupported() => false; +LunaQuickActions getQuickActions() => + throw UnsupportedError('LunaQuickActions unsupported'); diff --git a/lib/system/quick_actions/quick_actions.dart b/lib/system/quick_actions/quick_actions.dart new file mode 100644 index 00000000..2b9c58b8 --- /dev/null +++ b/lib/system/quick_actions/quick_actions.dart @@ -0,0 +1,12 @@ +import 'platform/quick_actions_stub.dart' + if (dart.library.io) 'platform/quick_actions_io.dart' + if (dart.library.html) 'platform/quick_actions_html.dart'; + +abstract class LunaQuickActions { + static bool get isSupported => isPlatformSupported(); + factory LunaQuickActions() => getQuickActions(); + + Future initialize(); + void setActionItems(); + void actionHandler(String action); +} diff --git a/lib/core/system/window_manager/platform/window_manager_html.dart b/lib/system/window_manager/platform/window_manager_html.dart similarity index 100% rename from lib/core/system/window_manager/platform/window_manager_html.dart rename to lib/system/window_manager/platform/window_manager_html.dart diff --git a/lib/core/system/window_manager/platform/window_manager_io.dart b/lib/system/window_manager/platform/window_manager_io.dart similarity index 100% rename from lib/core/system/window_manager/platform/window_manager_io.dart rename to lib/system/window_manager/platform/window_manager_io.dart diff --git a/lib/core/system/window_manager/platform/window_manager_stub.dart b/lib/system/window_manager/platform/window_manager_stub.dart similarity index 100% rename from lib/core/system/window_manager/platform/window_manager_stub.dart rename to lib/system/window_manager/platform/window_manager_stub.dart diff --git a/lib/core/system/window_manager/window_manager.dart b/lib/system/window_manager/window_manager.dart similarity index 100% rename from lib/core/system/window_manager/window_manager.dart rename to lib/system/window_manager/window_manager.dart diff --git a/lib/core/ui/appbar.dart b/lib/ui/appbar.dart similarity index 100% rename from lib/core/ui/appbar.dart rename to lib/ui/appbar.dart diff --git a/lib/core/ui/banner.dart b/lib/ui/banner.dart similarity index 100% rename from lib/core/ui/banner.dart rename to lib/ui/banner.dart diff --git a/lib/core/ui/block.dart b/lib/ui/block.dart similarity index 100% rename from lib/core/ui/block.dart rename to lib/ui/block.dart diff --git a/lib/core/ui/block/block.dart b/lib/ui/block/block.dart similarity index 100% rename from lib/core/ui/block/block.dart rename to lib/ui/block/block.dart diff --git a/lib/core/ui/block/grid_block.dart b/lib/ui/block/grid_block.dart similarity index 100% rename from lib/core/ui/block/grid_block.dart rename to lib/ui/block/grid_block.dart diff --git a/lib/core/ui/bottom_bar.dart b/lib/ui/bottom_bar.dart similarity index 100% rename from lib/core/ui/bottom_bar.dart rename to lib/ui/bottom_bar.dart diff --git a/lib/core/ui/bottom_bar/action_bar.dart b/lib/ui/bottom_bar/action_bar.dart similarity index 100% rename from lib/core/ui/bottom_bar/action_bar.dart rename to lib/ui/bottom_bar/action_bar.dart diff --git a/lib/core/ui/bottom_bar/action_bar_card.dart b/lib/ui/bottom_bar/action_bar_card.dart similarity index 100% rename from lib/core/ui/bottom_bar/action_bar_card.dart rename to lib/ui/bottom_bar/action_bar_card.dart diff --git a/lib/core/ui/bottom_bar/badge.dart b/lib/ui/bottom_bar/badge.dart similarity index 100% rename from lib/core/ui/bottom_bar/badge.dart rename to lib/ui/bottom_bar/badge.dart diff --git a/lib/core/ui/bottom_bar/navigation_bar.dart b/lib/ui/bottom_bar/navigation_bar.dart similarity index 100% rename from lib/core/ui/bottom_bar/navigation_bar.dart rename to lib/ui/bottom_bar/navigation_bar.dart diff --git a/lib/core/ui/bottom_modal_sheet.dart b/lib/ui/bottom_modal_sheet.dart similarity index 100% rename from lib/core/ui/bottom_modal_sheet.dart rename to lib/ui/bottom_modal_sheet.dart diff --git a/lib/core/ui/button.dart b/lib/ui/button.dart similarity index 100% rename from lib/core/ui/button.dart rename to lib/ui/button.dart diff --git a/lib/core/ui/card.dart b/lib/ui/card.dart similarity index 100% rename from lib/core/ui/card.dart rename to lib/ui/card.dart diff --git a/lib/core/ui/colors.dart b/lib/ui/colors.dart similarity index 100% rename from lib/core/ui/colors.dart rename to lib/ui/colors.dart diff --git a/lib/core/ui/containers.dart b/lib/ui/containers.dart similarity index 100% rename from lib/core/ui/containers.dart rename to lib/ui/containers.dart diff --git a/lib/core/ui/containers/button_container.dart b/lib/ui/containers/button_container.dart similarity index 100% rename from lib/core/ui/containers/button_container.dart rename to lib/ui/containers/button_container.dart diff --git a/lib/core/ui/controllers.dart b/lib/ui/controllers.dart similarity index 100% rename from lib/core/ui/controllers.dart rename to lib/ui/controllers.dart diff --git a/lib/core/ui/controllers/page_controller.dart b/lib/ui/controllers/page_controller.dart similarity index 100% rename from lib/core/ui/controllers/page_controller.dart rename to lib/ui/controllers/page_controller.dart diff --git a/lib/core/ui/deprecated.dart b/lib/ui/deprecated.dart similarity index 100% rename from lib/core/ui/deprecated.dart rename to lib/ui/deprecated.dart diff --git a/lib/core/ui/dialog.dart b/lib/ui/dialog.dart similarity index 100% rename from lib/core/ui/dialog.dart rename to lib/ui/dialog.dart diff --git a/lib/core/ui/divider.dart b/lib/ui/divider.dart similarity index 100% rename from lib/core/ui/divider.dart rename to lib/ui/divider.dart diff --git a/lib/core/ui/drawer.dart b/lib/ui/drawer.dart similarity index 100% rename from lib/core/ui/drawer.dart rename to lib/ui/drawer.dart diff --git a/lib/core/ui/drawer/drawer.dart b/lib/ui/drawer/drawer.dart similarity index 100% rename from lib/core/ui/drawer/drawer.dart rename to lib/ui/drawer/drawer.dart diff --git a/lib/core/ui/drawer/drawer_header.dart b/lib/ui/drawer/drawer_header.dart similarity index 100% rename from lib/core/ui/drawer/drawer_header.dart rename to lib/ui/drawer/drawer_header.dart diff --git a/lib/core/ui/floating_action_button.dart b/lib/ui/floating_action_button.dart similarity index 100% rename from lib/core/ui/floating_action_button.dart rename to lib/ui/floating_action_button.dart diff --git a/lib/core/ui/floating_action_button/floating_action_button_animated.dart b/lib/ui/floating_action_button/floating_action_button_animated.dart similarity index 100% rename from lib/core/ui/floating_action_button/floating_action_button_animated.dart rename to lib/ui/floating_action_button/floating_action_button_animated.dart diff --git a/lib/core/ui/floating_action_button/floating_action_button_extended.dart b/lib/ui/floating_action_button/floating_action_button_extended.dart similarity index 100% rename from lib/core/ui/floating_action_button/floating_action_button_extended.dart rename to lib/ui/floating_action_button/floating_action_button_extended.dart diff --git a/lib/core/ui/grid_view.dart b/lib/ui/grid_view.dart similarity index 100% rename from lib/core/ui/grid_view.dart rename to lib/ui/grid_view.dart diff --git a/lib/core/ui/grid_view/grid_view_builder.dart b/lib/ui/grid_view/grid_view_builder.dart similarity index 100% rename from lib/core/ui/grid_view/grid_view_builder.dart rename to lib/ui/grid_view/grid_view_builder.dart diff --git a/lib/core/ui/header.dart b/lib/ui/header.dart similarity index 100% rename from lib/core/ui/header.dart rename to lib/ui/header.dart diff --git a/lib/core/ui/highlighted_node.dart b/lib/ui/highlighted_node.dart similarity index 100% rename from lib/core/ui/highlighted_node.dart rename to lib/ui/highlighted_node.dart diff --git a/lib/core/ui/icons.dart b/lib/ui/icons.dart similarity index 100% rename from lib/core/ui/icons.dart rename to lib/ui/icons.dart diff --git a/lib/core/ui/icons/icon.dart b/lib/ui/icons/icon.dart similarity index 100% rename from lib/core/ui/icons/icon.dart rename to lib/ui/icons/icon.dart diff --git a/lib/core/ui/icons/icon_brands.dart b/lib/ui/icons/icon_brands.dart similarity index 100% rename from lib/core/ui/icons/icon_brands.dart rename to lib/ui/icons/icon_brands.dart diff --git a/lib/core/ui/icons/icon_button.dart b/lib/ui/icons/icon_button.dart similarity index 100% rename from lib/core/ui/icons/icon_button.dart rename to lib/ui/icons/icon_button.dart diff --git a/lib/core/ui/images.dart b/lib/ui/images.dart similarity index 100% rename from lib/core/ui/images.dart rename to lib/ui/images.dart diff --git a/lib/core/ui/images/network_image.dart b/lib/ui/images/network_image.dart similarity index 100% rename from lib/core/ui/images/network_image.dart rename to lib/ui/images/network_image.dart diff --git a/lib/core/ui/images/network_image_provider/network_image_provider.dart b/lib/ui/images/network_image_provider/network_image_provider.dart similarity index 100% rename from lib/core/ui/images/network_image_provider/network_image_provider.dart rename to lib/ui/images/network_image_provider/network_image_provider.dart diff --git a/lib/core/ui/images/network_image_provider/platform/network_image_provider_html.dart b/lib/ui/images/network_image_provider/platform/network_image_provider_html.dart similarity index 100% rename from lib/core/ui/images/network_image_provider/platform/network_image_provider_html.dart rename to lib/ui/images/network_image_provider/platform/network_image_provider_html.dart diff --git a/lib/core/ui/images/network_image_provider/platform/network_image_provider_io.dart b/lib/ui/images/network_image_provider/platform/network_image_provider_io.dart similarity index 93% rename from lib/core/ui/images/network_image_provider/platform/network_image_provider_io.dart rename to lib/ui/images/network_image_provider/platform/network_image_provider_io.dart index 8ff6810e..965b3f91 100644 --- a/lib/core/ui/images/network_image_provider/platform/network_image_provider_io.dart +++ b/lib/ui/images/network_image_provider/platform/network_image_provider_io.dart @@ -1,7 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; -import '../../../../cache/image_cache/image_cache.dart'; +import '../../../../core/cache/image_cache/image_cache.dart'; import '../network_image_provider.dart'; LunaNetworkImageProvider getNetworkImageProvider({ diff --git a/lib/core/ui/images/network_image_provider/platform/network_image_provider_stub.dart b/lib/ui/images/network_image_provider/platform/network_image_provider_stub.dart similarity index 100% rename from lib/core/ui/images/network_image_provider/platform/network_image_provider_stub.dart rename to lib/ui/images/network_image_provider/platform/network_image_provider_stub.dart diff --git a/lib/core/ui/input_bar.dart b/lib/ui/input_bar.dart similarity index 100% rename from lib/core/ui/input_bar.dart rename to lib/ui/input_bar.dart diff --git a/lib/core/ui/linear_indicator.dart b/lib/ui/linear_indicator.dart similarity index 100% rename from lib/core/ui/linear_indicator.dart rename to lib/ui/linear_indicator.dart diff --git a/lib/core/ui/list_tile.dart b/lib/ui/list_tile.dart similarity index 100% rename from lib/core/ui/list_tile.dart rename to lib/ui/list_tile.dart diff --git a/lib/core/ui/list_tile/expandable_list_tile.dart b/lib/ui/list_tile/expandable_list_tile.dart similarity index 100% rename from lib/core/ui/list_tile/expandable_list_tile.dart rename to lib/ui/list_tile/expandable_list_tile.dart diff --git a/lib/core/ui/list_tile/list_tile.dart b/lib/ui/list_tile/list_tile.dart similarity index 100% rename from lib/core/ui/list_tile/list_tile.dart rename to lib/ui/list_tile/list_tile.dart diff --git a/lib/core/ui/list_view.dart b/lib/ui/list_view.dart similarity index 100% rename from lib/core/ui/list_view.dart rename to lib/ui/list_view.dart diff --git a/lib/core/ui/list_view/flutter_reorderable_list_view.dart b/lib/ui/list_view/flutter_reorderable_list_view.dart similarity index 100% rename from lib/core/ui/list_view/flutter_reorderable_list_view.dart rename to lib/ui/list_view/flutter_reorderable_list_view.dart diff --git a/lib/core/ui/list_view/list_view.dart b/lib/ui/list_view/list_view.dart similarity index 100% rename from lib/core/ui/list_view/list_view.dart rename to lib/ui/list_view/list_view.dart diff --git a/lib/core/ui/list_view/list_view_builder.dart b/lib/ui/list_view/list_view_builder.dart similarity index 100% rename from lib/core/ui/list_view/list_view_builder.dart rename to lib/ui/list_view/list_view_builder.dart diff --git a/lib/core/ui/list_view/list_view_modal.dart b/lib/ui/list_view/list_view_modal.dart similarity index 100% rename from lib/core/ui/list_view/list_view_modal.dart rename to lib/ui/list_view/list_view_modal.dart diff --git a/lib/core/ui/list_view/list_view_modal_builder.dart b/lib/ui/list_view/list_view_modal_builder.dart similarity index 100% rename from lib/core/ui/list_view/list_view_modal_builder.dart rename to lib/ui/list_view/list_view_modal_builder.dart diff --git a/lib/core/ui/list_view/paged_list_view.dart b/lib/ui/list_view/paged_list_view.dart similarity index 100% rename from lib/core/ui/list_view/paged_list_view.dart rename to lib/ui/list_view/paged_list_view.dart diff --git a/lib/core/ui/list_view/reorderable_list_view.dart b/lib/ui/list_view/reorderable_list_view.dart similarity index 100% rename from lib/core/ui/list_view/reorderable_list_view.dart rename to lib/ui/list_view/reorderable_list_view.dart diff --git a/lib/core/ui/list_view/reorderable_list_view_builder.dart b/lib/ui/list_view/reorderable_list_view_builder.dart similarity index 100% rename from lib/core/ui/list_view/reorderable_list_view_builder.dart rename to lib/ui/list_view/reorderable_list_view_builder.dart diff --git a/lib/core/ui/list_view/reorderable_list_view_dragger.dart b/lib/ui/list_view/reorderable_list_view_dragger.dart similarity index 100% rename from lib/core/ui/list_view/reorderable_list_view_dragger.dart rename to lib/ui/list_view/reorderable_list_view_dragger.dart diff --git a/lib/core/ui/loader.dart b/lib/ui/loader.dart similarity index 100% rename from lib/core/ui/loader.dart rename to lib/ui/loader.dart diff --git a/lib/core/ui/message.dart b/lib/ui/message.dart similarity index 100% rename from lib/core/ui/message.dart rename to lib/ui/message.dart diff --git a/lib/core/mixins.dart b/lib/ui/mixins.dart similarity index 100% rename from lib/core/mixins.dart rename to lib/ui/mixins.dart diff --git a/lib/core/mixins/load_callback.dart b/lib/ui/mixins/load_callback.dart similarity index 100% rename from lib/core/mixins/load_callback.dart rename to lib/ui/mixins/load_callback.dart diff --git a/lib/core/mixins/scroll_controller.dart b/lib/ui/mixins/scroll_controller.dart similarity index 100% rename from lib/core/mixins/scroll_controller.dart rename to lib/ui/mixins/scroll_controller.dart diff --git a/lib/core/ui/page_view.dart b/lib/ui/page_view.dart similarity index 100% rename from lib/core/ui/page_view.dart rename to lib/ui/page_view.dart diff --git a/lib/core/ui/popup_menu_button.dart b/lib/ui/popup_menu_button.dart similarity index 100% rename from lib/core/ui/popup_menu_button.dart rename to lib/ui/popup_menu_button.dart diff --git a/lib/core/ui/refresh_indicator.dart b/lib/ui/refresh_indicator.dart similarity index 100% rename from lib/core/ui/refresh_indicator.dart rename to lib/ui/refresh_indicator.dart diff --git a/lib/core/ui/scaffold.dart b/lib/ui/scaffold.dart similarity index 100% rename from lib/core/ui/scaffold.dart rename to lib/ui/scaffold.dart diff --git a/lib/core/ui/scroll_behaviour.dart b/lib/ui/scroll_behaviour.dart similarity index 100% rename from lib/core/ui/scroll_behaviour.dart rename to lib/ui/scroll_behaviour.dart diff --git a/lib/core/ui/shape.dart b/lib/ui/shape.dart similarity index 100% rename from lib/core/ui/shape.dart rename to lib/ui/shape.dart diff --git a/lib/core/ui/shimmer.dart b/lib/ui/shimmer.dart similarity index 100% rename from lib/core/ui/shimmer.dart rename to lib/ui/shimmer.dart diff --git a/lib/core/ui/snackbar.dart b/lib/ui/snackbar.dart similarity index 100% rename from lib/core/ui/snackbar.dart rename to lib/ui/snackbar.dart diff --git a/lib/core/ui/snackbar/snackbar.dart b/lib/ui/snackbar/snackbar.dart similarity index 100% rename from lib/core/ui/snackbar/snackbar.dart rename to lib/ui/snackbar/snackbar.dart diff --git a/lib/core/ui/snackbar/snackbar_error.dart b/lib/ui/snackbar/snackbar_error.dart similarity index 100% rename from lib/core/ui/snackbar/snackbar_error.dart rename to lib/ui/snackbar/snackbar_error.dart diff --git a/lib/core/ui/snackbar/snackbar_info.dart b/lib/ui/snackbar/snackbar_info.dart similarity index 100% rename from lib/core/ui/snackbar/snackbar_info.dart rename to lib/ui/snackbar/snackbar_info.dart diff --git a/lib/core/ui/snackbar/snackbar_success.dart b/lib/ui/snackbar/snackbar_success.dart similarity index 100% rename from lib/core/ui/snackbar/snackbar_success.dart rename to lib/ui/snackbar/snackbar_success.dart diff --git a/lib/core/ui/switch.dart b/lib/ui/switch.dart similarity index 100% rename from lib/core/ui/switch.dart rename to lib/ui/switch.dart diff --git a/lib/core/ui/table.dart b/lib/ui/table.dart similarity index 100% rename from lib/core/ui/table.dart rename to lib/ui/table.dart diff --git a/lib/core/ui/table/table_card.dart b/lib/ui/table/table_card.dart similarity index 100% rename from lib/core/ui/table/table_card.dart rename to lib/ui/table/table_card.dart diff --git a/lib/core/ui/table/table_content.dart b/lib/ui/table/table_content.dart similarity index 100% rename from lib/core/ui/table/table_content.dart rename to lib/ui/table/table_content.dart diff --git a/lib/core/ui/text.dart b/lib/ui/text.dart similarity index 100% rename from lib/core/ui/text.dart rename to lib/ui/text.dart diff --git a/lib/core/ui/text_span.dart b/lib/ui/text_span.dart similarity index 100% rename from lib/core/ui/text_span.dart rename to lib/ui/text_span.dart diff --git a/lib/core/ui/text_style.dart b/lib/ui/text_style.dart similarity index 100% rename from lib/core/ui/text_style.dart rename to lib/ui/text_style.dart diff --git a/lib/core/ui/theme.dart b/lib/ui/theme.dart similarity index 100% rename from lib/core/ui/theme.dart rename to lib/ui/theme.dart diff --git a/lib/core/ui.dart b/lib/ui/ui.dart similarity index 73% rename from lib/core/ui.dart rename to lib/ui/ui.dart index d7d44834..c421dd5a 100644 --- a/lib/core/ui.dart +++ b/lib/ui/ui.dart @@ -3,46 +3,47 @@ import 'package:lunasea/core.dart'; export 'package:easy_localization/easy_localization.dart'; -export 'ui/appbar.dart'; -export 'ui/banner.dart'; -export 'ui/block.dart'; -export 'ui/bottom_bar.dart'; -export 'ui/bottom_modal_sheet.dart'; -export 'ui/button.dart'; -export 'ui/card.dart'; -export 'ui/colors.dart'; -export 'ui/containers.dart'; -export 'ui/controllers.dart'; -export 'ui/dialog.dart'; -export 'ui/divider.dart'; -export 'ui/drawer.dart'; -export 'ui/floating_action_button.dart'; -export 'ui/grid_view.dart'; -export 'ui/header.dart'; -export 'ui/highlighted_node.dart'; -export 'ui/icons.dart'; -export 'ui/input_bar.dart'; -export 'ui/linear_indicator.dart'; -export 'ui/list_tile.dart'; -export 'ui/list_view.dart'; -export 'ui/loader.dart'; -export 'ui/message.dart'; -export 'ui/images.dart'; -export 'ui/page_view.dart'; -export 'ui/popup_menu_button.dart'; -export 'ui/refresh_indicator.dart'; -export 'ui/scaffold.dart'; -export 'ui/scroll_behaviour.dart'; -export 'ui/shape.dart'; -export 'ui/shimmer.dart'; -export 'ui/snackbar.dart'; -export 'ui/switch.dart'; -export 'ui/table.dart'; -export 'ui/text_span.dart'; -export 'ui/text_style.dart'; -export 'ui/text.dart'; -export 'ui/theme.dart'; -export 'ui/will_pop_scope.dart'; +export 'appbar.dart'; +export 'banner.dart'; +export 'block.dart'; +export 'bottom_bar.dart'; +export 'bottom_modal_sheet.dart'; +export 'button.dart'; +export 'card.dart'; +export 'colors.dart'; +export 'containers.dart'; +export 'controllers.dart'; +export 'dialog.dart'; +export 'divider.dart'; +export 'drawer.dart'; +export 'floating_action_button.dart'; +export 'grid_view.dart'; +export 'header.dart'; +export 'highlighted_node.dart'; +export 'icons.dart'; +export 'input_bar.dart'; +export 'linear_indicator.dart'; +export 'list_tile.dart'; +export 'list_view.dart'; +export 'loader.dart'; +export 'message.dart'; +export 'mixins.dart'; +export 'images.dart'; +export 'page_view.dart'; +export 'popup_menu_button.dart'; +export 'refresh_indicator.dart'; +export 'scaffold.dart'; +export 'scroll_behaviour.dart'; +export 'shape.dart'; +export 'shimmer.dart'; +export 'snackbar.dart'; +export 'switch.dart'; +export 'table.dart'; +export 'text_span.dart'; +export 'text_style.dart'; +export 'text.dart'; +export 'theme.dart'; +export 'will_pop_scope.dart'; // ignore: avoid_classes_with_only_static_members class LunaUI { diff --git a/lib/core/ui/will_pop_scope.dart b/lib/ui/will_pop_scope.dart similarity index 100% rename from lib/core/ui/will_pop_scope.dart rename to lib/ui/will_pop_scope.dart