diff --git a/mobile/lib/data/years.dart b/mobile/lib/data/years.dart index 2b2e04d911..5f496d2a68 100644 --- a/mobile/lib/data/years.dart +++ b/mobile/lib/data/years.dart @@ -1,4 +1,4 @@ -import 'package:photos/utils/date_time_util.dart'; +import 'package:photos/utils/standalone/date_time.dart'; class YearsData { final List yearsData = []; diff --git a/mobile/lib/emergency/other_contact_page.dart b/mobile/lib/emergency/other_contact_page.dart index 07605b59da..89235aa330 100644 --- a/mobile/lib/emergency/other_contact_page.dart +++ b/mobile/lib/emergency/other_contact_page.dart @@ -17,9 +17,9 @@ import "package:photos/ui/components/menu_item_widget/menu_item_widget.dart"; import "package:photos/ui/components/menu_section_title.dart"; import "package:photos/ui/components/models/button_type.dart"; import "package:photos/ui/components/title_bar_title_widget.dart"; -import "package:photos/utils/date_time_util.dart"; import "package:photos/utils/dialog_util.dart"; import "package:photos/utils/navigation_util.dart"; +import "package:photos/utils/standalone/date_time.dart"; // OtherContactPage is used to start recovery process for other user's account // Based on the state of the contact & recovery session, it will show diff --git a/mobile/lib/models/file/file.dart b/mobile/lib/models/file/file.dart index 705d740e82..eea913a1bc 100644 --- a/mobile/lib/models/file/file.dart +++ b/mobile/lib/models/file/file.dart @@ -10,10 +10,10 @@ import 'package:photos/models/file/file_type.dart'; import 'package:photos/models/location/location.dart'; import "package:photos/models/metadata/file_magic.dart"; import "package:photos/service_locator.dart"; -import 'package:photos/utils/date_time_util.dart'; import 'package:photos/utils/exif_util.dart'; import 'package:photos/utils/file_uploader_util.dart'; import "package:photos/utils/panorama_util.dart"; +import 'package:photos/utils/standalone/date_time.dart'; //Todo: files with no location data have lat and long set to 0.0. This should ideally be null. class EnteFile { diff --git a/mobile/lib/models/ml/face/box.dart b/mobile/lib/models/ml/face/box.dart index d5d8672fb9..8d4adfd112 100644 --- a/mobile/lib/models/ml/face/box.dart +++ b/mobile/lib/models/ml/face/box.dart @@ -1,4 +1,4 @@ -import "package:photos/utils/parse.dart"; +import "package:photos/utils/standalone/parse.dart"; /// Bounding box of a face. /// diff --git a/mobile/lib/models/ml/face/face.dart b/mobile/lib/models/ml/face/face.dart index 1001d4988e..5e4c554e3b 100644 --- a/mobile/lib/models/ml/face/face.dart +++ b/mobile/lib/models/ml/face/face.dart @@ -4,7 +4,7 @@ import "package:photos/models/ml/face/dimension.dart"; import "package:photos/models/ml/face/landmark.dart"; import 'package:photos/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart'; import "package:photos/services/machine_learning/ml_result.dart"; -import "package:photos/utils/parse.dart"; +import "package:photos/utils/standalone/parse.dart"; // FileInfo contains the image width and height of the image the face was detected in. class FileInfo { diff --git a/mobile/lib/services/filedata/model/file_data.dart b/mobile/lib/services/filedata/model/file_data.dart index 4aedf96128..7de75dbb06 100644 --- a/mobile/lib/services/filedata/model/file_data.dart +++ b/mobile/lib/services/filedata/model/file_data.dart @@ -1,5 +1,5 @@ import "package:photos/models/ml/face/face.dart"; -import "package:photos/utils/parse.dart"; +import "package:photos/utils/standalone/parse.dart"; const _faceKey = 'face'; const _clipKey = 'clip'; diff --git a/mobile/lib/services/files_service.dart b/mobile/lib/services/files_service.dart index 36cfe7d50d..d6f0994f30 100644 --- a/mobile/lib/services/files_service.dart +++ b/mobile/lib/services/files_service.dart @@ -18,7 +18,7 @@ import "package:photos/services/ignored_files_service.dart"; import "package:photos/ui/components/action_sheet_widget.dart"; import "package:photos/ui/components/buttons/button_widget.dart"; import "package:photos/ui/components/models/button_type.dart"; -import 'package:photos/utils/date_time_util.dart'; +import 'package:photos/utils/standalone/date_time.dart'; class FilesService { late Dio _enteDio; diff --git a/mobile/lib/services/search_service.dart b/mobile/lib/services/search_service.dart index 94cce83bd2..73c74c8aef 100644 --- a/mobile/lib/services/search_service.dart +++ b/mobile/lib/services/search_service.dart @@ -52,9 +52,9 @@ import "package:photos/ui/viewer/location/location_screen.dart"; import "package:photos/ui/viewer/people/cluster_page.dart"; import "package:photos/ui/viewer/people/people_page.dart"; import "package:photos/ui/viewer/search/result/magic_result_screen.dart"; -import 'package:photos/utils/date_time_util.dart'; import "package:photos/utils/file_util.dart"; import "package:photos/utils/navigation_util.dart"; +import 'package:photos/utils/standalone/date_time.dart'; import 'package:tuple/tuple.dart'; class SearchService { diff --git a/mobile/lib/services/sync/local_sync_service.dart b/mobile/lib/services/sync/local_sync_service.dart index e875ae2751..f8d4326722 100644 --- a/mobile/lib/services/sync/local_sync_service.dart +++ b/mobile/lib/services/sync/local_sync_service.dart @@ -19,9 +19,9 @@ import "package:photos/models/ignored_file.dart"; import 'package:photos/services/app_lifecycle_service.dart'; import "package:photos/services/ignored_files_service.dart"; import 'package:photos/services/local/local_sync_util.dart'; -import "package:photos/utils/debouncer.dart"; import "package:photos/utils/photo_manager_util.dart"; import "package:photos/utils/sqlite_util.dart"; +import "package:photos/utils/standalone/debouncer.dart"; import 'package:shared_preferences/shared_preferences.dart'; import 'package:synchronized/synchronized.dart'; import 'package:tuple/tuple.dart'; diff --git a/mobile/lib/states/all_sections_examples_state.dart b/mobile/lib/states/all_sections_examples_state.dart index abb0077ef3..19e640d318 100644 --- a/mobile/lib/states/all_sections_examples_state.dart +++ b/mobile/lib/states/all_sections_examples_state.dart @@ -10,7 +10,7 @@ import "package:photos/events/people_changed_event.dart"; import "package:photos/events/tab_changed_event.dart"; import "package:photos/models/search/search_result.dart"; import "package:photos/models/search/search_types.dart"; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class AllSectionsExamplesProvider extends StatefulWidget { final Widget child; diff --git a/mobile/lib/states/location_state.dart b/mobile/lib/states/location_state.dart index 8ab32e55e8..2227f324e3 100644 --- a/mobile/lib/states/location_state.dart +++ b/mobile/lib/states/location_state.dart @@ -9,7 +9,7 @@ import "package:photos/models/local_entity_data.dart"; import "package:photos/models/location/location.dart"; import "package:photos/models/location_tag/location_tag.dart"; import "package:photos/models/typedefs.dart"; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class LocationTagStateProvider extends StatefulWidget { final LocalEntity? locationTagEntity; diff --git a/mobile/lib/ui/account/sessions_page.dart b/mobile/lib/ui/account/sessions_page.dart index 64eaf80d72..ed3c48407b 100644 --- a/mobile/lib/ui/account/sessions_page.dart +++ b/mobile/lib/ui/account/sessions_page.dart @@ -8,8 +8,8 @@ import 'package:photos/services/account/user_service.dart'; import "package:photos/theme/ente_theme.dart"; import 'package:photos/ui/common/loading_widget.dart'; import 'package:photos/ui/notification/toast.dart'; -import "package:photos/utils/date_time_util.dart"; import 'package:photos/utils/dialog_util.dart'; +import "package:photos/utils/standalone/date_time.dart"; class SessionsPage extends StatefulWidget { const SessionsPage({super.key}); diff --git a/mobile/lib/ui/actions/collection/collection_sharing_actions.dart b/mobile/lib/ui/actions/collection/collection_sharing_actions.dart index 7c8074bd7b..87b552269d 100644 --- a/mobile/lib/ui/actions/collection/collection_sharing_actions.dart +++ b/mobile/lib/ui/actions/collection/collection_sharing_actions.dart @@ -27,10 +27,10 @@ import 'package:photos/ui/components/dialog_widget.dart'; import 'package:photos/ui/components/models/button_type.dart'; import 'package:photos/ui/notification/toast.dart'; import 'package:photos/ui/payment/subscription.dart'; -import 'package:photos/utils/date_time_util.dart'; import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/email_util.dart'; import 'package:photos/utils/share_util.dart'; +import 'package:photos/utils/standalone/date_time.dart'; import "package:styled_text/styled_text.dart"; class CollectionActions { diff --git a/mobile/lib/ui/collections/device/device_folders_grid_view.dart b/mobile/lib/ui/collections/device/device_folders_grid_view.dart index 6f4ac30f0f..d6c04e0bed 100644 --- a/mobile/lib/ui/collections/device/device_folders_grid_view.dart +++ b/mobile/lib/ui/collections/device/device_folders_grid_view.dart @@ -12,7 +12,7 @@ import 'package:photos/models/device_collection.dart'; import "package:photos/ui/collections/device/device_folder_item.dart"; import 'package:photos/ui/common/loading_widget.dart'; import 'package:photos/ui/viewer/gallery/empty_state.dart'; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class DeviceFoldersGridView extends StatefulWidget { const DeviceFoldersGridView({ diff --git a/mobile/lib/ui/collections/device/device_folders_vertical_grid_view.dart b/mobile/lib/ui/collections/device/device_folders_vertical_grid_view.dart index c0acc66af6..d42bad8dd5 100644 --- a/mobile/lib/ui/collections/device/device_folders_vertical_grid_view.dart +++ b/mobile/lib/ui/collections/device/device_folders_vertical_grid_view.dart @@ -13,7 +13,7 @@ import 'package:photos/models/device_collection.dart'; import "package:photos/ui/collections/device/device_folder_item.dart"; import 'package:photos/ui/common/loading_widget.dart'; import 'package:photos/ui/viewer/gallery/empty_state.dart'; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class DeviceFolderVerticalGridView extends StatelessWidget { final Widget? appTitle; diff --git a/mobile/lib/ui/components/buttons/button_widget.dart b/mobile/lib/ui/components/buttons/button_widget.dart index 7590735b10..84012da5b8 100644 --- a/mobile/lib/ui/components/buttons/button_widget.dart +++ b/mobile/lib/ui/components/buttons/button_widget.dart @@ -9,8 +9,8 @@ import 'package:photos/theme/text_style.dart'; import 'package:photos/ui/common/loading_widget.dart'; import 'package:photos/ui/components/models/button_type.dart'; import 'package:photos/ui/components/models/custom_button_style.dart'; -import 'package:photos/utils/debouncer.dart'; import "package:photos/utils/dialog_util.dart"; +import 'package:photos/utils/standalone/debouncer.dart'; enum ButtonSize { small, diff --git a/mobile/lib/ui/components/menu_item_widget/menu_item_widget.dart b/mobile/lib/ui/components/menu_item_widget/menu_item_widget.dart index f737de5f9c..dfd2479057 100644 --- a/mobile/lib/ui/components/menu_item_widget/menu_item_widget.dart +++ b/mobile/lib/ui/components/menu_item_widget/menu_item_widget.dart @@ -4,7 +4,7 @@ import 'package:photos/models/execution_states.dart'; import 'package:photos/models/typedefs.dart'; import 'package:photos/theme/ente_theme.dart'; import 'package:photos/ui/components/menu_item_widget/menu_item_child_widgets.dart'; -import 'package:photos/utils/debouncer.dart'; +import 'package:photos/utils/standalone/debouncer.dart'; class MenuItemWidget extends StatefulWidget { final Widget captionedTextWidget; diff --git a/mobile/lib/ui/components/text_input_widget.dart b/mobile/lib/ui/components/text_input_widget.dart index 965de67c48..4a59bbe7ee 100644 --- a/mobile/lib/ui/components/text_input_widget.dart +++ b/mobile/lib/ui/components/text_input_widget.dart @@ -5,8 +5,8 @@ import 'package:photos/models/execution_states.dart'; import 'package:photos/models/typedefs.dart'; import 'package:photos/theme/ente_theme.dart'; import 'package:photos/ui/common/loading_widget.dart'; -import 'package:photos/utils/debouncer.dart'; import 'package:photos/utils/separators_util.dart'; +import 'package:photos/utils/standalone/debouncer.dart'; ///To show wrong password state, throw an exception with the message ///"Incorrect password" in onSubmit. diff --git a/mobile/lib/ui/components/toggle_switch_widget.dart b/mobile/lib/ui/components/toggle_switch_widget.dart index f04cbfc99b..ec631f6fa8 100644 --- a/mobile/lib/ui/components/toggle_switch_widget.dart +++ b/mobile/lib/ui/components/toggle_switch_widget.dart @@ -6,7 +6,7 @@ import 'package:photos/ente_theme_data.dart'; import 'package:photos/models/execution_states.dart'; import 'package:photos/models/typedefs.dart'; import 'package:photos/ui/common/loading_widget.dart'; -import 'package:photos/utils/debouncer.dart'; +import 'package:photos/utils/standalone/debouncer.dart'; class ToggleSwitchWidget extends StatefulWidget { final BoolCallBack value; diff --git a/mobile/lib/ui/growth/referral_screen.dart b/mobile/lib/ui/growth/referral_screen.dart index 426bb3e015..0d82c54edb 100644 --- a/mobile/lib/ui/growth/referral_screen.dart +++ b/mobile/lib/ui/growth/referral_screen.dart @@ -16,9 +16,9 @@ import "package:photos/ui/components/title_bar_widget.dart"; import "package:photos/ui/growth/apply_code_screen.dart"; import "package:photos/ui/growth/referral_code_widget.dart"; import "package:photos/ui/growth/storage_details_screen.dart"; -import "package:photos/utils/data_util.dart"; import "package:photos/utils/navigation_util.dart"; import "package:photos/utils/share_util.dart"; +import "package:photos/utils/standalone/data.dart"; import "package:tuple/tuple.dart"; class ReferralScreen extends StatefulWidget { diff --git a/mobile/lib/ui/growth/storage_details_screen.dart b/mobile/lib/ui/growth/storage_details_screen.dart index 286772593c..c1c9bcf1a0 100644 --- a/mobile/lib/ui/growth/storage_details_screen.dart +++ b/mobile/lib/ui/growth/storage_details_screen.dart @@ -10,7 +10,7 @@ import "package:photos/ui/common/loading_widget.dart"; import 'package:photos/ui/components/buttons/icon_button_widget.dart'; import "package:photos/ui/components/title_bar_title_widget.dart"; import "package:photos/ui/components/title_bar_widget.dart"; -import "package:photos/utils/data_util.dart"; +import "package:photos/utils/standalone/data.dart"; class StorageDetailsScreen extends StatefulWidget { final ReferralView referralView; diff --git a/mobile/lib/ui/home/home_gallery_widget.dart b/mobile/lib/ui/home/home_gallery_widget.dart index 0095b13fbb..35bc5eb326 100644 --- a/mobile/lib/ui/home/home_gallery_widget.dart +++ b/mobile/lib/ui/home/home_gallery_widget.dart @@ -19,7 +19,7 @@ import 'package:photos/ui/viewer/actions/file_selection_overlay_bar.dart'; import 'package:photos/ui/viewer/gallery/gallery.dart'; import "package:photos/ui/viewer/gallery/state/gallery_files_inherited_widget.dart"; import "package:photos/ui/viewer/gallery/state/selection_state.dart"; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class HomeGalleryWidget extends StatefulWidget { final Widget? header; diff --git a/mobile/lib/ui/map/map_view.dart b/mobile/lib/ui/map/map_view.dart index 3629da7e96..e25319b133 100644 --- a/mobile/lib/ui/map/map_view.dart +++ b/mobile/lib/ui/map/map_view.dart @@ -9,7 +9,7 @@ import "package:photos/ui/map/map_gallery_tile.dart"; import "package:photos/ui/map/map_gallery_tile_badge.dart"; import "package:photos/ui/map/map_marker.dart"; import "package:photos/ui/map/tile/layers.dart"; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class MapView extends StatefulWidget { final List imageMarkers; diff --git a/mobile/lib/ui/payment/add_on_page.dart b/mobile/lib/ui/payment/add_on_page.dart index fa7b3aba76..5701ea8cd0 100644 --- a/mobile/lib/ui/payment/add_on_page.dart +++ b/mobile/lib/ui/payment/add_on_page.dart @@ -6,7 +6,7 @@ import "package:photos/theme/ente_theme.dart"; import 'package:photos/ui/components/buttons/icon_button_widget.dart'; import "package:photos/ui/components/title_bar_title_widget.dart"; import "package:photos/ui/components/title_bar_widget.dart"; -import "package:photos/utils/data_util.dart"; +import "package:photos/utils/standalone/data.dart"; class AddOnPage extends StatelessWidget { final BonusData bonusData; diff --git a/mobile/lib/ui/payment/store_subscription_page.dart b/mobile/lib/ui/payment/store_subscription_page.dart index f0b833c367..b83b65b5d2 100644 --- a/mobile/lib/ui/payment/store_subscription_page.dart +++ b/mobile/lib/ui/payment/store_subscription_page.dart @@ -28,8 +28,8 @@ import 'package:photos/ui/payment/subscription_common_widgets.dart'; import 'package:photos/ui/payment/subscription_plan_widget.dart'; import "package:photos/ui/payment/view_add_on_widget.dart"; import "package:photos/ui/tabs/home_widget.dart"; -import "package:photos/utils/data_util.dart"; import 'package:photos/utils/dialog_util.dart'; +import "package:photos/utils/standalone/data.dart"; import 'package:url_launcher/url_launcher_string.dart'; class StoreSubscriptionPage extends StatefulWidget { diff --git a/mobile/lib/ui/payment/stripe_subscription_page.dart b/mobile/lib/ui/payment/stripe_subscription_page.dart index 707a427071..e88c2db0bb 100644 --- a/mobile/lib/ui/payment/stripe_subscription_page.dart +++ b/mobile/lib/ui/payment/stripe_subscription_page.dart @@ -28,8 +28,8 @@ import 'package:photos/ui/payment/subscription_common_widgets.dart'; import 'package:photos/ui/payment/subscription_plan_widget.dart'; import "package:photos/ui/payment/view_add_on_widget.dart"; import "package:photos/ui/tabs/home_widget.dart"; -import "package:photos/utils/data_util.dart"; import 'package:photos/utils/dialog_util.dart'; +import "package:photos/utils/standalone/data.dart"; import 'package:step_progress_indicator/step_progress_indicator.dart'; import 'package:url_launcher/url_launcher_string.dart'; diff --git a/mobile/lib/ui/payment/subscription_common_widgets.dart b/mobile/lib/ui/payment/subscription_common_widgets.dart index 84fe693b7f..faa4ebd1ac 100644 --- a/mobile/lib/ui/payment/subscription_common_widgets.dart +++ b/mobile/lib/ui/payment/subscription_common_widgets.dart @@ -8,7 +8,7 @@ import "package:photos/theme/ente_theme.dart"; import "package:photos/ui/components/captioned_text_widget.dart"; import "package:photos/ui/components/menu_item_widget/menu_item_widget.dart"; import 'package:photos/ui/payment/billing_questions_widget.dart'; -import 'package:photos/utils/data_util.dart'; +import 'package:photos/utils/standalone/data.dart'; class SubscriptionHeaderWidget extends StatefulWidget { final bool? isOnboarding; @@ -281,7 +281,9 @@ class _SubscriptionToggleState extends State { switchOutCurve: Curves.easeInOutExpo, child: Text( key: ValueKey(_isYearly), - _isYearly ? S.of(context).yearly : S.of(context).monthly, + _isYearly + ? S.of(context).yearly + : S.of(context).monthly, style: textTheme.body, ), ), diff --git a/mobile/lib/ui/payment/subscription_plan_widget.dart b/mobile/lib/ui/payment/subscription_plan_widget.dart index d23d06dab5..3a269ec2b5 100644 --- a/mobile/lib/ui/payment/subscription_plan_widget.dart +++ b/mobile/lib/ui/payment/subscription_plan_widget.dart @@ -6,7 +6,7 @@ import "package:photos/generated/l10n.dart"; import "package:photos/service_locator.dart"; import "package:photos/theme/colors.dart"; import "package:photos/theme/ente_theme.dart"; -import 'package:photos/utils/data_util.dart'; +import 'package:photos/utils/standalone/data.dart'; class SubscriptionPlanWidget extends StatefulWidget { const SubscriptionPlanWidget({ @@ -176,7 +176,10 @@ class _Price extends StatelessWidget { children: [ if (isPlayStore) Text( - currencySymbol + pricePerMonthString + ' / ' + S.of(context).month, + currencySymbol + + pricePerMonthString + + ' / ' + + S.of(context).month, style: textTheme.largeBold.copyWith(color: textBaseLight), ), if (isPlayStore) @@ -186,7 +189,10 @@ class _Price extends StatelessWidget { ), if (!isPlayStore) Text( - currencySymbol + pricePerMonthString + ' / ' + S.of(context).month, + currencySymbol + + pricePerMonthString + + ' / ' + + S.of(context).month, style: textTheme.largeBold.copyWith(color: textBaseLight), ), if (!isPlayStore) diff --git a/mobile/lib/ui/settings/backup/free_space_options.dart b/mobile/lib/ui/settings/backup/free_space_options.dart index c98d4e9b63..6d42e2040c 100644 --- a/mobile/lib/ui/settings/backup/free_space_options.dart +++ b/mobile/lib/ui/settings/backup/free_space_options.dart @@ -23,9 +23,9 @@ import "package:photos/ui/tools/debug/app_storage_viewer.dart"; import "package:photos/ui/tools/deduplicate_page.dart"; import "package:photos/ui/tools/free_space_page.dart"; import "package:photos/ui/viewer/gallery/large_files_page.dart"; -import "package:photos/utils/data_util.dart"; import "package:photos/utils/dialog_util.dart"; import 'package:photos/utils/navigation_util.dart'; +import "package:photos/utils/standalone/data.dart"; class FreeUpSpaceOptionsScreen extends StatefulWidget { const FreeUpSpaceOptionsScreen({super.key}); diff --git a/mobile/lib/ui/settings/storage_card_widget.dart b/mobile/lib/ui/settings/storage_card_widget.dart index ffc09fa550..8388e87038 100644 --- a/mobile/lib/ui/settings/storage_card_widget.dart +++ b/mobile/lib/ui/settings/storage_card_widget.dart @@ -11,7 +11,7 @@ import 'package:photos/theme/ente_theme.dart'; import "package:photos/ui/common/loading_widget.dart"; import 'package:photos/ui/payment/subscription.dart'; import 'package:photos/ui/settings/storage_progress_widget.dart'; -import 'package:photos/utils/data_util.dart'; +import 'package:photos/utils/standalone/data.dart'; class StorageCardWidget extends StatefulWidget { const StorageCardWidget({super.key}); diff --git a/mobile/lib/ui/sharing/manage_links_widget.dart b/mobile/lib/ui/sharing/manage_links_widget.dart index 86146b9c64..dfea026297 100644 --- a/mobile/lib/ui/sharing/manage_links_widget.dart +++ b/mobile/lib/ui/sharing/manage_links_widget.dart @@ -20,10 +20,10 @@ import "package:photos/ui/components/toggle_switch_widget.dart"; import 'package:photos/ui/notification/toast.dart'; import 'package:photos/ui/sharing/pickers/device_limit_picker_page.dart'; import 'package:photos/ui/sharing/pickers/link_expiry_picker_page.dart'; -import 'package:photos/utils/date_time_util.dart'; import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/navigation_util.dart'; import "package:photos/utils/share_util.dart"; +import 'package:photos/utils/standalone/date_time.dart'; class ManageSharedLinkWidget extends StatefulWidget { final Collection? collection; diff --git a/mobile/lib/ui/sharing/user_avator_widget.dart b/mobile/lib/ui/sharing/user_avator_widget.dart index c24158763e..7acd869f87 100644 --- a/mobile/lib/ui/sharing/user_avator_widget.dart +++ b/mobile/lib/ui/sharing/user_avator_widget.dart @@ -13,7 +13,7 @@ import "package:photos/services/machine_learning/face_ml/person/person_service.d import "package:photos/theme/colors.dart"; import 'package:photos/theme/ente_theme.dart'; import "package:photos/ui/viewer/search/result/person_face_widget.dart"; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/debouncer.dart"; import 'package:tuple/tuple.dart'; enum AvatarType { small, mini, tiny, extra } diff --git a/mobile/lib/ui/tabs/shared_collections_tab.dart b/mobile/lib/ui/tabs/shared_collections_tab.dart index a6e7f3c679..1f0fc3d727 100644 --- a/mobile/lib/ui/tabs/shared_collections_tab.dart +++ b/mobile/lib/ui/tabs/shared_collections_tab.dart @@ -20,8 +20,8 @@ import "package:photos/ui/tabs/shared/empty_state.dart"; import "package:photos/ui/tabs/shared/quick_link_album_item.dart"; import "package:photos/ui/viewer/gallery/collect_photos_card_widget.dart"; import "package:photos/ui/viewer/gallery/collection_page.dart"; -import "package:photos/utils/debouncer.dart"; import "package:photos/utils/navigation_util.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class SharedCollectionsTab extends StatefulWidget { const SharedCollectionsTab({super.key}); diff --git a/mobile/lib/ui/tabs/user_collections_tab.dart b/mobile/lib/ui/tabs/user_collections_tab.dart index 6f4621484d..afc6178c24 100644 --- a/mobile/lib/ui/tabs/user_collections_tab.dart +++ b/mobile/lib/ui/tabs/user_collections_tab.dart @@ -27,9 +27,9 @@ import 'package:photos/ui/components/buttons/icon_button_widget.dart'; import "package:photos/ui/tabs/section_title.dart"; import "package:photos/ui/viewer/actions/delete_empty_albums.dart"; import "package:photos/ui/viewer/gallery/empty_state.dart"; -import "package:photos/utils/debouncer.dart"; import 'package:photos/utils/local_settings.dart'; import "package:photos/utils/navigation_util.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class UserCollectionsTab extends StatefulWidget { const UserCollectionsTab({super.key}); diff --git a/mobile/lib/ui/tools/debug/app_storage_viewer.dart b/mobile/lib/ui/tools/debug/app_storage_viewer.dart index f5e58f1a8a..bb7abf3e51 100644 --- a/mobile/lib/ui/tools/debug/app_storage_viewer.dart +++ b/mobile/lib/ui/tools/debug/app_storage_viewer.dart @@ -16,7 +16,7 @@ import 'package:photos/ui/components/menu_section_title.dart'; import 'package:photos/ui/components/title_bar_title_widget.dart'; import 'package:photos/ui/components/title_bar_widget.dart'; import 'package:photos/ui/tools/debug/path_storage_viewer.dart'; -import 'package:photos/utils/directory_content.dart'; +import 'package:photos/utils/standalone/directory_content.dart'; class AppStorageViewer extends StatefulWidget { const AppStorageViewer({super.key}); diff --git a/mobile/lib/ui/tools/debug/path_storage_viewer.dart b/mobile/lib/ui/tools/debug/path_storage_viewer.dart index 63b4e0bde2..1859234175 100644 --- a/mobile/lib/ui/tools/debug/path_storage_viewer.dart +++ b/mobile/lib/ui/tools/debug/path_storage_viewer.dart @@ -7,8 +7,8 @@ import 'package:logging/logging.dart'; import 'package:photos/theme/ente_theme.dart'; import 'package:photos/ui/components/captioned_text_widget.dart'; import 'package:photos/ui/components/menu_item_widget/menu_item_widget.dart'; -import 'package:photos/utils/data_util.dart'; -import 'package:photos/utils/directory_content.dart'; +import 'package:photos/utils/standalone/data.dart'; +import 'package:photos/utils/standalone/directory_content.dart'; class PathStorageItem { final String path; diff --git a/mobile/lib/ui/tools/deduplicate_page.dart b/mobile/lib/ui/tools/deduplicate_page.dart index 8b8efd8dd8..579b458e0d 100644 --- a/mobile/lib/ui/tools/deduplicate_page.dart +++ b/mobile/lib/ui/tools/deduplicate_page.dart @@ -14,10 +14,10 @@ import "package:photos/theme/ente_theme.dart"; import 'package:photos/ui/viewer/file/detail_page.dart'; import 'package:photos/ui/viewer/file/thumbnail_widget.dart'; import 'package:photos/ui/viewer/gallery/empty_state.dart'; -import 'package:photos/utils/data_util.dart'; import 'package:photos/utils/delete_file_util.dart'; import "package:photos/utils/dialog_util.dart"; import 'package:photos/utils/navigation_util.dart'; +import 'package:photos/utils/standalone/data.dart'; class DeduplicatePage extends StatefulWidget { final List duplicates; diff --git a/mobile/lib/ui/tools/free_space_page.dart b/mobile/lib/ui/tools/free_space_page.dart index 3b60096d1f..b2cfab26b4 100644 --- a/mobile/lib/ui/tools/free_space_page.dart +++ b/mobile/lib/ui/tools/free_space_page.dart @@ -4,8 +4,8 @@ import 'package:logging/logging.dart'; import "package:photos/generated/l10n.dart"; import 'package:photos/models/backup_status.dart'; import 'package:photos/ui/common/gradient_button.dart'; -import 'package:photos/utils/data_util.dart'; import 'package:photos/utils/delete_file_util.dart'; +import 'package:photos/utils/standalone/data.dart'; class FreeSpacePage extends StatefulWidget { final BackupStatus status; diff --git a/mobile/lib/ui/viewer/file/file_icons_widget.dart b/mobile/lib/ui/viewer/file/file_icons_widget.dart index 9cc2554035..b7e675ff95 100644 --- a/mobile/lib/ui/viewer/file/file_icons_widget.dart +++ b/mobile/lib/ui/viewer/file/file_icons_widget.dart @@ -10,7 +10,7 @@ import 'package:photos/models/file/trash_file.dart'; import 'package:photos/theme/colors.dart'; import "package:photos/theme/ente_theme.dart"; import 'package:photos/ui/sharing/user_avator_widget.dart'; -import "package:photos/utils/data_util.dart"; +import "package:photos/utils/standalone/data.dart"; class ThumbnailPlaceHolder extends StatelessWidget { const ThumbnailPlaceHolder({super.key}); diff --git a/mobile/lib/ui/viewer/file/native_video_player_controls/seek_bar.dart b/mobile/lib/ui/viewer/file/native_video_player_controls/seek_bar.dart index dafd812db4..3250a912d5 100644 --- a/mobile/lib/ui/viewer/file/native_video_player_controls/seek_bar.dart +++ b/mobile/lib/ui/viewer/file/native_video_player_controls/seek_bar.dart @@ -5,7 +5,7 @@ import "package:native_video_player/native_video_player.dart"; import "package:photos/service_locator.dart"; import "package:photos/theme/colors.dart"; import "package:photos/theme/ente_theme.dart"; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class SeekBar extends StatefulWidget { final NativeVideoPlayerController controller; diff --git a/mobile/lib/ui/viewer/file/video_widget_media_kit_common.dart b/mobile/lib/ui/viewer/file/video_widget_media_kit_common.dart index e2b0229591..df9f819637 100644 --- a/mobile/lib/ui/viewer/file/video_widget_media_kit_common.dart +++ b/mobile/lib/ui/viewer/file/video_widget_media_kit_common.dart @@ -6,8 +6,8 @@ import "package:photos/models/file/file.dart"; import "package:photos/theme/colors.dart"; import "package:photos/theme/ente_theme.dart"; import "package:photos/ui/viewer/file/preview_status_widget.dart"; -import "package:photos/utils/date_time_util.dart"; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/date_time.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class VideoWidget extends StatefulWidget { final EnteFile file; diff --git a/mobile/lib/ui/viewer/file/video_widget_media_kit_preview.dart b/mobile/lib/ui/viewer/file/video_widget_media_kit_preview.dart index 9d6bce668c..35bf1ad58e 100644 --- a/mobile/lib/ui/viewer/file/video_widget_media_kit_preview.dart +++ b/mobile/lib/ui/viewer/file/video_widget_media_kit_preview.dart @@ -19,8 +19,8 @@ import "package:photos/ui/common/loading_widget.dart"; import "package:photos/ui/notification/toast.dart"; import "package:photos/ui/viewer/file/video_widget_media_kit_common.dart" as common; -import "package:photos/utils/data_util.dart"; import "package:photos/utils/file_util.dart"; +import "package:photos/utils/standalone/data.dart"; class VideoWidgetMediaKitPreview extends StatefulWidget { final EnteFile file; diff --git a/mobile/lib/ui/viewer/file/video_widget_native.dart b/mobile/lib/ui/viewer/file/video_widget_native.dart index 53cc67483e..8d9858f6b7 100644 --- a/mobile/lib/ui/viewer/file/video_widget_native.dart +++ b/mobile/lib/ui/viewer/file/video_widget_native.dart @@ -25,11 +25,11 @@ import "package:photos/ui/viewer/file/native_video_player_controls/play_pause_bu import "package:photos/ui/viewer/file/native_video_player_controls/seek_bar.dart"; import "package:photos/ui/viewer/file/preview_status_widget.dart"; import "package:photos/ui/viewer/file/thumbnail_widget.dart"; -import "package:photos/utils/date_time_util.dart"; -import "package:photos/utils/debouncer.dart"; import "package:photos/utils/dialog_util.dart"; import "package:photos/utils/exif_util.dart"; import "package:photos/utils/file_util.dart"; +import "package:photos/utils/standalone/date_time.dart"; +import "package:photos/utils/standalone/debouncer.dart"; import "package:visibility_detector/visibility_detector.dart"; class VideoWidgetNative extends StatefulWidget { diff --git a/mobile/lib/ui/viewer/file_details/backed_up_time_item_widget.dart b/mobile/lib/ui/viewer/file_details/backed_up_time_item_widget.dart index 28f9cff870..813b32ced9 100644 --- a/mobile/lib/ui/viewer/file_details/backed_up_time_item_widget.dart +++ b/mobile/lib/ui/viewer/file_details/backed_up_time_item_widget.dart @@ -3,7 +3,7 @@ import "package:intl/intl.dart"; import 'package:photos/models/file/file.dart'; import "package:photos/theme/ente_theme.dart"; import "package:photos/ui/components/info_item_widget.dart"; -import "package:photos/utils/date_time_util.dart"; +import "package:photos/utils/standalone/date_time.dart"; class BackedUpTimeItemWidget extends StatelessWidget { final EnteFile file; diff --git a/mobile/lib/ui/viewer/file_details/creation_time_item_widget.dart b/mobile/lib/ui/viewer/file_details/creation_time_item_widget.dart index 13c8800fa8..e86bbafc18 100644 --- a/mobile/lib/ui/viewer/file_details/creation_time_item_widget.dart +++ b/mobile/lib/ui/viewer/file_details/creation_time_item_widget.dart @@ -6,8 +6,8 @@ import "package:photos/l10n/l10n.dart"; import 'package:photos/models/file/file.dart'; import "package:photos/theme/ente_theme.dart"; import "package:photos/ui/components/info_item_widget.dart"; -import "package:photos/utils/date_time_util.dart"; import "package:photos/utils/magic_util.dart"; +import "package:photos/utils/standalone/date_time.dart"; class CreationTimeItem extends StatefulWidget { final EnteFile file; diff --git a/mobile/lib/ui/viewer/file_details/file_properties_item_widget.dart b/mobile/lib/ui/viewer/file_details/file_properties_item_widget.dart index 0640f92eeb..2cedc1da2b 100644 --- a/mobile/lib/ui/viewer/file_details/file_properties_item_widget.dart +++ b/mobile/lib/ui/viewer/file_details/file_properties_item_widget.dart @@ -4,10 +4,10 @@ import 'package:photos/models/file/file.dart'; import 'package:photos/models/file/file_type.dart'; import "package:photos/theme/ente_theme.dart"; import "package:photos/ui/components/info_item_widget.dart"; -import "package:photos/utils/data_util.dart"; -import "package:photos/utils/date_time_util.dart"; import "package:photos/utils/file_util.dart"; import "package:photos/utils/magic_util.dart"; +import "package:photos/utils/standalone/data.dart"; +import "package:photos/utils/standalone/date_time.dart"; class FilePropertiesItemWidget extends StatefulWidget { final EnteFile file; diff --git a/mobile/lib/ui/viewer/file_details/preview_properties_item_widget.dart b/mobile/lib/ui/viewer/file_details/preview_properties_item_widget.dart index aec1b9fa3d..6e5d15d7d5 100644 --- a/mobile/lib/ui/viewer/file_details/preview_properties_item_widget.dart +++ b/mobile/lib/ui/viewer/file_details/preview_properties_item_widget.dart @@ -6,7 +6,7 @@ import "package:photos/models/file/file_type.dart"; import "package:photos/services/preview_video_store.dart"; import "package:photos/theme/ente_theme.dart"; import "package:photos/ui/components/info_item_widget.dart"; -import "package:photos/utils/data_util.dart"; +import "package:photos/utils/standalone/data.dart"; class PreviewPropertiesItemWidget extends StatefulWidget { final EnteFile file; diff --git a/mobile/lib/ui/viewer/gallery/component/group/type.dart b/mobile/lib/ui/viewer/gallery/component/group/type.dart index 19b1224de9..079ddb1e2e 100644 --- a/mobile/lib/ui/viewer/gallery/component/group/type.dart +++ b/mobile/lib/ui/viewer/gallery/component/group/type.dart @@ -3,7 +3,7 @@ import "package:intl/intl.dart"; import "package:photos/core/constants.dart"; import "package:photos/generated/l10n.dart"; import "package:photos/models/file/file.dart"; -import "package:photos/utils/date_time_util.dart"; +import "package:photos/utils/standalone/date_time.dart"; enum GroupType { day, diff --git a/mobile/lib/ui/viewer/gallery/component/multiple_groups_gallery_view.dart b/mobile/lib/ui/viewer/gallery/component/multiple_groups_gallery_view.dart index d4ecf73520..de38d22fda 100644 --- a/mobile/lib/ui/viewer/gallery/component/multiple_groups_gallery_view.dart +++ b/mobile/lib/ui/viewer/gallery/component/multiple_groups_gallery_view.dart @@ -13,7 +13,7 @@ import 'package:photos/ui/viewer/gallery/component/group/lazy_group_gallery.dart import "package:photos/ui/viewer/gallery/component/group/type.dart"; import "package:photos/ui/viewer/gallery/gallery.dart"; import "package:photos/ui/viewer/gallery/state/gallery_context_state.dart"; -import "package:photos/utils/data_util.dart"; +import "package:photos/utils/standalone/data.dart"; import "package:scrollable_positioned_list/scrollable_positioned_list.dart"; /* diff --git a/mobile/lib/ui/viewer/gallery/gallery.dart b/mobile/lib/ui/viewer/gallery/gallery.dart index 970992a91e..f48209669e 100644 --- a/mobile/lib/ui/viewer/gallery/gallery.dart +++ b/mobile/lib/ui/viewer/gallery/gallery.dart @@ -18,9 +18,9 @@ import 'package:photos/ui/viewer/gallery/empty_state.dart'; import "package:photos/ui/viewer/gallery/state/gallery_context_state.dart"; import "package:photos/ui/viewer/gallery/state/gallery_files_inherited_widget.dart"; import "package:photos/ui/viewer/gallery/state/inherited_search_filter_data.dart"; -import "package:photos/utils/date_time_util.dart"; -import "package:photos/utils/debouncer.dart"; import "package:photos/utils/hierarchical_search_util.dart"; +import "package:photos/utils/standalone/date_time.dart"; +import "package:photos/utils/standalone/debouncer.dart"; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; typedef GalleryLoader = Future Function( diff --git a/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart index 0bc6c5e568..d29def8033 100644 --- a/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart +++ b/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart @@ -50,11 +50,11 @@ import "package:photos/ui/viewer/gallery/state/inherited_search_filter_data.dart import "package:photos/ui/viewer/hierarchicial_search/applied_filters_for_appbar.dart"; import "package:photos/ui/viewer/hierarchicial_search/recommended_filters_for_appbar.dart"; import "package:photos/ui/viewer/location/edit_location_sheet.dart"; -import 'package:photos/utils/data_util.dart'; import 'package:photos/utils/dialog_util.dart'; import "package:photos/utils/file_download_util.dart"; import 'package:photos/utils/magic_util.dart'; import 'package:photos/utils/navigation_util.dart'; +import 'package:photos/utils/standalone/data.dart'; import "package:uuid/uuid.dart"; class GalleryAppBarWidget extends StatefulWidget { diff --git a/mobile/lib/ui/viewer/search/search_widget.dart b/mobile/lib/ui/viewer/search/search_widget.dart index a71254a0c7..1461d37f99 100644 --- a/mobile/lib/ui/viewer/search/search_widget.dart +++ b/mobile/lib/ui/viewer/search/search_widget.dart @@ -13,8 +13,8 @@ import "package:photos/models/search/search_result.dart"; import "package:photos/services/search_service.dart"; import "package:photos/theme/ente_theme.dart"; import "package:photos/ui/viewer/search/search_suffix_icon_widget.dart"; -import "package:photos/utils/date_time_util.dart"; -import "package:photos/utils/debouncer.dart"; +import "package:photos/utils/standalone/date_time.dart"; +import "package:photos/utils/standalone/debouncer.dart"; class SearchWidget extends StatefulWidget { const SearchWidget({super.key}); diff --git a/mobile/lib/utils/file_download_util.dart b/mobile/lib/utils/file_download_util.dart index f5982abd19..420ad34713 100644 --- a/mobile/lib/utils/file_download_util.dart +++ b/mobile/lib/utils/file_download_util.dart @@ -19,10 +19,10 @@ import "package:photos/models/ignored_file.dart"; import "package:photos/services/collections_service.dart"; import "package:photos/services/ignored_files_service.dart"; import "package:photos/services/sync/local_sync_service.dart"; -import "package:photos/utils/data_util.dart"; -import "package:photos/utils/fake_progress.dart"; import "package:photos/utils/file_key.dart"; import "package:photos/utils/file_util.dart"; +import "package:photos/utils/standalone/data.dart"; +import "package:photos/utils/standalone/fake_progress.dart"; final _logger = Logger("file_download_util"); diff --git a/mobile/lib/utils/file_uploader.dart b/mobile/lib/utils/file_uploader.dart index 2855b83c78..5d78af6a06 100644 --- a/mobile/lib/utils/file_uploader.dart +++ b/mobile/lib/utils/file_uploader.dart @@ -39,12 +39,12 @@ import 'package:photos/services/collections_service.dart'; import "package:photos/services/preview_video_store.dart"; import 'package:photos/services/sync/local_sync_service.dart'; import 'package:photos/services/sync/sync_service.dart'; -import 'package:photos/utils/data_util.dart'; import "package:photos/utils/exif_util.dart"; import "package:photos/utils/file_key.dart"; import 'package:photos/utils/file_uploader_util.dart'; import "package:photos/utils/file_util.dart"; import "package:photos/utils/network_util.dart"; +import 'package:photos/utils/standalone/data.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:tuple/tuple.dart'; import "package:uuid/uuid.dart"; diff --git a/mobile/lib/utils/share_util.dart b/mobile/lib/utils/share_util.dart index 694bc6cff6..2efd8bd1e6 100644 --- a/mobile/lib/utils/share_util.dart +++ b/mobile/lib/utils/share_util.dart @@ -14,10 +14,10 @@ import "package:photos/models/collection/collection.dart"; import 'package:photos/models/file/file.dart'; import 'package:photos/models/file/file_type.dart'; import "package:photos/ui/sharing/show_images_prevew.dart"; -import 'package:photos/utils/date_time_util.dart'; import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/exif_util.dart'; import 'package:photos/utils/file_util.dart'; +import 'package:photos/utils/standalone/date_time.dart'; import 'package:receive_sharing_intent/receive_sharing_intent.dart'; import "package:screenshot/screenshot.dart"; import 'package:share_plus/share_plus.dart'; diff --git a/mobile/lib/utils/standalone/README.md b/mobile/lib/utils/standalone/README.md new file mode 100644 index 0000000000..f0e2884aef --- /dev/null +++ b/mobile/lib/utils/standalone/README.md @@ -0,0 +1,3 @@ +## Standalone Utils +This folder contains standalone utilities that can be used in any project. These utilities are not dependent on any other part of the project and can be used independently. +The utils inside this folder are not dependent on any other part of the project and can be used independently. \ No newline at end of file diff --git a/mobile/lib/utils/data_util.dart b/mobile/lib/utils/standalone/data.dart similarity index 100% rename from mobile/lib/utils/data_util.dart rename to mobile/lib/utils/standalone/data.dart diff --git a/mobile/lib/utils/date_time_util.dart b/mobile/lib/utils/standalone/date_time.dart similarity index 100% rename from mobile/lib/utils/date_time_util.dart rename to mobile/lib/utils/standalone/date_time.dart diff --git a/mobile/lib/utils/debouncer.dart b/mobile/lib/utils/standalone/debouncer.dart similarity index 95% rename from mobile/lib/utils/debouncer.dart rename to mobile/lib/utils/standalone/debouncer.dart index 07097440f0..fc0e6d6359 100644 --- a/mobile/lib/utils/debouncer.dart +++ b/mobile/lib/utils/standalone/debouncer.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import "package:photos/models/typedefs.dart"; ///Do not forget to cancel the debounce's timer using [cancelDebounceTimer] ///when the debouncer is no longer needed @@ -21,7 +20,7 @@ class Debouncer { final Stopwatch _stopwatch = Stopwatch(); - void run(FutureVoidCallback fn) { + void run(Future Function() fn) { if (leading && !isActive()) { _stopwatch.stop(); _stopwatch.reset(); diff --git a/mobile/lib/utils/directory_content.dart b/mobile/lib/utils/standalone/directory_content.dart similarity index 98% rename from mobile/lib/utils/directory_content.dart rename to mobile/lib/utils/standalone/directory_content.dart index 654e3af245..a868e51c0c 100644 --- a/mobile/lib/utils/directory_content.dart +++ b/mobile/lib/utils/standalone/directory_content.dart @@ -1,7 +1,7 @@ import 'dart:io'; import "package:path/path.dart"; -import "package:photos/utils/data_util.dart"; +import "package:photos/utils/standalone/data.dart"; class DirectoryStat { final String path; diff --git a/mobile/lib/utils/fake_progress.dart b/mobile/lib/utils/standalone/fake_progress.dart similarity index 100% rename from mobile/lib/utils/fake_progress.dart rename to mobile/lib/utils/standalone/fake_progress.dart diff --git a/mobile/lib/utils/parse.dart b/mobile/lib/utils/standalone/parse.dart similarity index 100% rename from mobile/lib/utils/parse.dart rename to mobile/lib/utils/standalone/parse.dart diff --git a/mobile/test/utils/date_time_util_test.dart b/mobile/test/utils/date_time_util_test.dart index 5025299a1c..ac89231ee8 100644 --- a/mobile/test/utils/date_time_util_test.dart +++ b/mobile/test/utils/date_time_util_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:photos/core/constants.dart'; -import 'package:photos/utils/date_time_util.dart'; +import "package:photos/utils/standalone/date_time.dart"; import 'package:test/test.dart'; void main() {