This commit is contained in:
Neeraj Gupta 2025-03-05 12:00:02 +05:30
parent 0c722171be
commit 3ac937a244
63 changed files with 79 additions and 69 deletions

View File

@ -1,4 +1,4 @@
import 'package:photos/utils/date_time_util.dart'; import 'package:photos/utils/standalone/date_time.dart';
class YearsData { class YearsData {
final List<YearData> yearsData = []; final List<YearData> yearsData = [];

View File

@ -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/menu_section_title.dart";
import "package:photos/ui/components/models/button_type.dart"; import "package:photos/ui/components/models/button_type.dart";
import "package:photos/ui/components/title_bar_title_widget.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/dialog_util.dart";
import "package:photos/utils/navigation_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 // OtherContactPage is used to start recovery process for other user's account
// Based on the state of the contact & recovery session, it will show // Based on the state of the contact & recovery session, it will show

View File

@ -10,10 +10,10 @@ import 'package:photos/models/file/file_type.dart';
import 'package:photos/models/location/location.dart'; import 'package:photos/models/location/location.dart';
import "package:photos/models/metadata/file_magic.dart"; import "package:photos/models/metadata/file_magic.dart";
import "package:photos/service_locator.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/exif_util.dart';
import 'package:photos/utils/file_uploader_util.dart'; import 'package:photos/utils/file_uploader_util.dart';
import "package:photos/utils/panorama_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. //Todo: files with no location data have lat and long set to 0.0. This should ideally be null.
class EnteFile { class EnteFile {

View File

@ -1,4 +1,4 @@
import "package:photos/utils/parse.dart"; import "package:photos/utils/standalone/parse.dart";
/// Bounding box of a face. /// Bounding box of a face.
/// ///

View File

@ -4,7 +4,7 @@ import "package:photos/models/ml/face/dimension.dart";
import "package:photos/models/ml/face/landmark.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/face_ml/face_filtering/face_filtering_constants.dart';
import "package:photos/services/machine_learning/ml_result.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. // FileInfo contains the image width and height of the image the face was detected in.
class FileInfo { class FileInfo {

View File

@ -1,5 +1,5 @@
import "package:photos/models/ml/face/face.dart"; 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 _faceKey = 'face';
const _clipKey = 'clip'; const _clipKey = 'clip';

View File

@ -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/action_sheet_widget.dart";
import "package:photos/ui/components/buttons/button_widget.dart"; import "package:photos/ui/components/buttons/button_widget.dart";
import "package:photos/ui/components/models/button_type.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 { class FilesService {
late Dio _enteDio; late Dio _enteDio;

View File

@ -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/cluster_page.dart";
import "package:photos/ui/viewer/people/people_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/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/file_util.dart";
import "package:photos/utils/navigation_util.dart"; import "package:photos/utils/navigation_util.dart";
import 'package:photos/utils/standalone/date_time.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';
class SearchService { class SearchService {

View File

@ -19,9 +19,9 @@ import "package:photos/models/ignored_file.dart";
import 'package:photos/services/app_lifecycle_service.dart'; import 'package:photos/services/app_lifecycle_service.dart';
import "package:photos/services/ignored_files_service.dart"; import "package:photos/services/ignored_files_service.dart";
import 'package:photos/services/local/local_sync_util.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/photo_manager_util.dart";
import "package:photos/utils/sqlite_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:shared_preferences/shared_preferences.dart';
import 'package:synchronized/synchronized.dart'; import 'package:synchronized/synchronized.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';

View File

@ -10,7 +10,7 @@ import "package:photos/events/people_changed_event.dart";
import "package:photos/events/tab_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_result.dart";
import "package:photos/models/search/search_types.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 { class AllSectionsExamplesProvider extends StatefulWidget {
final Widget child; final Widget child;

View File

@ -9,7 +9,7 @@ import "package:photos/models/local_entity_data.dart";
import "package:photos/models/location/location.dart"; import "package:photos/models/location/location.dart";
import "package:photos/models/location_tag/location_tag.dart"; import "package:photos/models/location_tag/location_tag.dart";
import "package:photos/models/typedefs.dart"; import "package:photos/models/typedefs.dart";
import "package:photos/utils/debouncer.dart"; import "package:photos/utils/standalone/debouncer.dart";
class LocationTagStateProvider extends StatefulWidget { class LocationTagStateProvider extends StatefulWidget {
final LocalEntity<LocationTag>? locationTagEntity; final LocalEntity<LocationTag>? locationTagEntity;

View File

@ -8,8 +8,8 @@ import 'package:photos/services/account/user_service.dart';
import "package:photos/theme/ente_theme.dart"; import "package:photos/theme/ente_theme.dart";
import 'package:photos/ui/common/loading_widget.dart'; import 'package:photos/ui/common/loading_widget.dart';
import 'package:photos/ui/notification/toast.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/dialog_util.dart';
import "package:photos/utils/standalone/date_time.dart";
class SessionsPage extends StatefulWidget { class SessionsPage extends StatefulWidget {
const SessionsPage({super.key}); const SessionsPage({super.key});

View File

@ -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/components/models/button_type.dart';
import 'package:photos/ui/notification/toast.dart'; import 'package:photos/ui/notification/toast.dart';
import 'package:photos/ui/payment/subscription.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/dialog_util.dart';
import 'package:photos/utils/email_util.dart'; import 'package:photos/utils/email_util.dart';
import 'package:photos/utils/share_util.dart'; import 'package:photos/utils/share_util.dart';
import 'package:photos/utils/standalone/date_time.dart';
import "package:styled_text/styled_text.dart"; import "package:styled_text/styled_text.dart";
class CollectionActions { class CollectionActions {

View File

@ -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/collections/device/device_folder_item.dart";
import 'package:photos/ui/common/loading_widget.dart'; import 'package:photos/ui/common/loading_widget.dart';
import 'package:photos/ui/viewer/gallery/empty_state.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 { class DeviceFoldersGridView extends StatefulWidget {
const DeviceFoldersGridView({ const DeviceFoldersGridView({

View File

@ -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/collections/device/device_folder_item.dart";
import 'package:photos/ui/common/loading_widget.dart'; import 'package:photos/ui/common/loading_widget.dart';
import 'package:photos/ui/viewer/gallery/empty_state.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 { class DeviceFolderVerticalGridView extends StatelessWidget {
final Widget? appTitle; final Widget? appTitle;

View File

@ -9,8 +9,8 @@ import 'package:photos/theme/text_style.dart';
import 'package:photos/ui/common/loading_widget.dart'; import 'package:photos/ui/common/loading_widget.dart';
import 'package:photos/ui/components/models/button_type.dart'; import 'package:photos/ui/components/models/button_type.dart';
import 'package:photos/ui/components/models/custom_button_style.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/dialog_util.dart";
import 'package:photos/utils/standalone/debouncer.dart';
enum ButtonSize { enum ButtonSize {
small, small,

View File

@ -4,7 +4,7 @@ import 'package:photos/models/execution_states.dart';
import 'package:photos/models/typedefs.dart'; import 'package:photos/models/typedefs.dart';
import 'package:photos/theme/ente_theme.dart'; import 'package:photos/theme/ente_theme.dart';
import 'package:photos/ui/components/menu_item_widget/menu_item_child_widgets.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 { class MenuItemWidget extends StatefulWidget {
final Widget captionedTextWidget; final Widget captionedTextWidget;

View File

@ -5,8 +5,8 @@ import 'package:photos/models/execution_states.dart';
import 'package:photos/models/typedefs.dart'; import 'package:photos/models/typedefs.dart';
import 'package:photos/theme/ente_theme.dart'; import 'package:photos/theme/ente_theme.dart';
import 'package:photos/ui/common/loading_widget.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/separators_util.dart';
import 'package:photos/utils/standalone/debouncer.dart';
///To show wrong password state, throw an exception with the message ///To show wrong password state, throw an exception with the message
///"Incorrect password" in onSubmit. ///"Incorrect password" in onSubmit.

View File

@ -6,7 +6,7 @@ import 'package:photos/ente_theme_data.dart';
import 'package:photos/models/execution_states.dart'; import 'package:photos/models/execution_states.dart';
import 'package:photos/models/typedefs.dart'; import 'package:photos/models/typedefs.dart';
import 'package:photos/ui/common/loading_widget.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 { class ToggleSwitchWidget extends StatefulWidget {
final BoolCallBack value; final BoolCallBack value;

View File

@ -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/apply_code_screen.dart";
import "package:photos/ui/growth/referral_code_widget.dart"; import "package:photos/ui/growth/referral_code_widget.dart";
import "package:photos/ui/growth/storage_details_screen.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/navigation_util.dart";
import "package:photos/utils/share_util.dart"; import "package:photos/utils/share_util.dart";
import "package:photos/utils/standalone/data.dart";
import "package:tuple/tuple.dart"; import "package:tuple/tuple.dart";
class ReferralScreen extends StatefulWidget { class ReferralScreen extends StatefulWidget {

View File

@ -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/buttons/icon_button_widget.dart';
import "package:photos/ui/components/title_bar_title_widget.dart"; import "package:photos/ui/components/title_bar_title_widget.dart";
import "package:photos/ui/components/title_bar_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 { class StorageDetailsScreen extends StatefulWidget {
final ReferralView referralView; final ReferralView referralView;

View File

@ -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/gallery.dart';
import "package:photos/ui/viewer/gallery/state/gallery_files_inherited_widget.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/ui/viewer/gallery/state/selection_state.dart";
import "package:photos/utils/debouncer.dart"; import "package:photos/utils/standalone/debouncer.dart";
class HomeGalleryWidget extends StatefulWidget { class HomeGalleryWidget extends StatefulWidget {
final Widget? header; final Widget? header;

View File

@ -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_gallery_tile_badge.dart";
import "package:photos/ui/map/map_marker.dart"; import "package:photos/ui/map/map_marker.dart";
import "package:photos/ui/map/tile/layers.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 { class MapView extends StatefulWidget {
final List<ImageMarker> imageMarkers; final List<ImageMarker> imageMarkers;

View File

@ -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/buttons/icon_button_widget.dart';
import "package:photos/ui/components/title_bar_title_widget.dart"; import "package:photos/ui/components/title_bar_title_widget.dart";
import "package:photos/ui/components/title_bar_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 { class AddOnPage extends StatelessWidget {
final BonusData bonusData; final BonusData bonusData;

View File

@ -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/subscription_plan_widget.dart';
import "package:photos/ui/payment/view_add_on_widget.dart"; import "package:photos/ui/payment/view_add_on_widget.dart";
import "package:photos/ui/tabs/home_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/dialog_util.dart';
import "package:photos/utils/standalone/data.dart";
import 'package:url_launcher/url_launcher_string.dart'; import 'package:url_launcher/url_launcher_string.dart';
class StoreSubscriptionPage extends StatefulWidget { class StoreSubscriptionPage extends StatefulWidget {

View File

@ -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/subscription_plan_widget.dart';
import "package:photos/ui/payment/view_add_on_widget.dart"; import "package:photos/ui/payment/view_add_on_widget.dart";
import "package:photos/ui/tabs/home_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/dialog_util.dart';
import "package:photos/utils/standalone/data.dart";
import 'package:step_progress_indicator/step_progress_indicator.dart'; import 'package:step_progress_indicator/step_progress_indicator.dart';
import 'package:url_launcher/url_launcher_string.dart'; import 'package:url_launcher/url_launcher_string.dart';

View File

@ -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/captioned_text_widget.dart";
import "package:photos/ui/components/menu_item_widget/menu_item_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/ui/payment/billing_questions_widget.dart';
import 'package:photos/utils/data_util.dart'; import 'package:photos/utils/standalone/data.dart';
class SubscriptionHeaderWidget extends StatefulWidget { class SubscriptionHeaderWidget extends StatefulWidget {
final bool? isOnboarding; final bool? isOnboarding;
@ -281,7 +281,9 @@ class _SubscriptionToggleState extends State<SubscriptionToggle> {
switchOutCurve: Curves.easeInOutExpo, switchOutCurve: Curves.easeInOutExpo,
child: Text( child: Text(
key: ValueKey(_isYearly), key: ValueKey(_isYearly),
_isYearly ? S.of(context).yearly : S.of(context).monthly, _isYearly
? S.of(context).yearly
: S.of(context).monthly,
style: textTheme.body, style: textTheme.body,
), ),
), ),

View File

@ -6,7 +6,7 @@ import "package:photos/generated/l10n.dart";
import "package:photos/service_locator.dart"; import "package:photos/service_locator.dart";
import "package:photos/theme/colors.dart"; import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.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 { class SubscriptionPlanWidget extends StatefulWidget {
const SubscriptionPlanWidget({ const SubscriptionPlanWidget({
@ -176,7 +176,10 @@ class _Price extends StatelessWidget {
children: [ children: [
if (isPlayStore) if (isPlayStore)
Text( Text(
currencySymbol + pricePerMonthString + ' / ' + S.of(context).month, currencySymbol +
pricePerMonthString +
' / ' +
S.of(context).month,
style: textTheme.largeBold.copyWith(color: textBaseLight), style: textTheme.largeBold.copyWith(color: textBaseLight),
), ),
if (isPlayStore) if (isPlayStore)
@ -186,7 +189,10 @@ class _Price extends StatelessWidget {
), ),
if (!isPlayStore) if (!isPlayStore)
Text( Text(
currencySymbol + pricePerMonthString + ' / ' + S.of(context).month, currencySymbol +
pricePerMonthString +
' / ' +
S.of(context).month,
style: textTheme.largeBold.copyWith(color: textBaseLight), style: textTheme.largeBold.copyWith(color: textBaseLight),
), ),
if (!isPlayStore) if (!isPlayStore)

View File

@ -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/deduplicate_page.dart";
import "package:photos/ui/tools/free_space_page.dart"; import "package:photos/ui/tools/free_space_page.dart";
import "package:photos/ui/viewer/gallery/large_files_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/dialog_util.dart";
import 'package:photos/utils/navigation_util.dart'; import 'package:photos/utils/navigation_util.dart';
import "package:photos/utils/standalone/data.dart";
class FreeUpSpaceOptionsScreen extends StatefulWidget { class FreeUpSpaceOptionsScreen extends StatefulWidget {
const FreeUpSpaceOptionsScreen({super.key}); const FreeUpSpaceOptionsScreen({super.key});

View File

@ -11,7 +11,7 @@ import 'package:photos/theme/ente_theme.dart';
import "package:photos/ui/common/loading_widget.dart"; import "package:photos/ui/common/loading_widget.dart";
import 'package:photos/ui/payment/subscription.dart'; import 'package:photos/ui/payment/subscription.dart';
import 'package:photos/ui/settings/storage_progress_widget.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 { class StorageCardWidget extends StatefulWidget {
const StorageCardWidget({super.key}); const StorageCardWidget({super.key});

View File

@ -20,10 +20,10 @@ import "package:photos/ui/components/toggle_switch_widget.dart";
import 'package:photos/ui/notification/toast.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/device_limit_picker_page.dart';
import 'package:photos/ui/sharing/pickers/link_expiry_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/dialog_util.dart';
import 'package:photos/utils/navigation_util.dart'; import 'package:photos/utils/navigation_util.dart';
import "package:photos/utils/share_util.dart"; import "package:photos/utils/share_util.dart";
import 'package:photos/utils/standalone/date_time.dart';
class ManageSharedLinkWidget extends StatefulWidget { class ManageSharedLinkWidget extends StatefulWidget {
final Collection? collection; final Collection? collection;

View File

@ -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/colors.dart";
import 'package:photos/theme/ente_theme.dart'; import 'package:photos/theme/ente_theme.dart';
import "package:photos/ui/viewer/search/result/person_face_widget.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'; import 'package:tuple/tuple.dart';
enum AvatarType { small, mini, tiny, extra } enum AvatarType { small, mini, tiny, extra }

View File

@ -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/tabs/shared/quick_link_album_item.dart";
import "package:photos/ui/viewer/gallery/collect_photos_card_widget.dart"; import "package:photos/ui/viewer/gallery/collect_photos_card_widget.dart";
import "package:photos/ui/viewer/gallery/collection_page.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/navigation_util.dart";
import "package:photos/utils/standalone/debouncer.dart";
class SharedCollectionsTab extends StatefulWidget { class SharedCollectionsTab extends StatefulWidget {
const SharedCollectionsTab({super.key}); const SharedCollectionsTab({super.key});

View File

@ -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/tabs/section_title.dart";
import "package:photos/ui/viewer/actions/delete_empty_albums.dart"; import "package:photos/ui/viewer/actions/delete_empty_albums.dart";
import "package:photos/ui/viewer/gallery/empty_state.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/local_settings.dart';
import "package:photos/utils/navigation_util.dart"; import "package:photos/utils/navigation_util.dart";
import "package:photos/utils/standalone/debouncer.dart";
class UserCollectionsTab extends StatefulWidget { class UserCollectionsTab extends StatefulWidget {
const UserCollectionsTab({super.key}); const UserCollectionsTab({super.key});

View File

@ -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_title_widget.dart';
import 'package:photos/ui/components/title_bar_widget.dart'; import 'package:photos/ui/components/title_bar_widget.dart';
import 'package:photos/ui/tools/debug/path_storage_viewer.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 { class AppStorageViewer extends StatefulWidget {
const AppStorageViewer({super.key}); const AppStorageViewer({super.key});

View File

@ -7,8 +7,8 @@ import 'package:logging/logging.dart';
import 'package:photos/theme/ente_theme.dart'; import 'package:photos/theme/ente_theme.dart';
import 'package:photos/ui/components/captioned_text_widget.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/components/menu_item_widget/menu_item_widget.dart';
import 'package:photos/utils/data_util.dart'; import 'package:photos/utils/standalone/data.dart';
import 'package:photos/utils/directory_content.dart'; import 'package:photos/utils/standalone/directory_content.dart';
class PathStorageItem { class PathStorageItem {
final String path; final String path;

View File

@ -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/detail_page.dart';
import 'package:photos/ui/viewer/file/thumbnail_widget.dart'; import 'package:photos/ui/viewer/file/thumbnail_widget.dart';
import 'package:photos/ui/viewer/gallery/empty_state.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/delete_file_util.dart';
import "package:photos/utils/dialog_util.dart"; import "package:photos/utils/dialog_util.dart";
import 'package:photos/utils/navigation_util.dart'; import 'package:photos/utils/navigation_util.dart';
import 'package:photos/utils/standalone/data.dart';
class DeduplicatePage extends StatefulWidget { class DeduplicatePage extends StatefulWidget {
final List<DuplicateFiles> duplicates; final List<DuplicateFiles> duplicates;

View File

@ -4,8 +4,8 @@ import 'package:logging/logging.dart';
import "package:photos/generated/l10n.dart"; import "package:photos/generated/l10n.dart";
import 'package:photos/models/backup_status.dart'; import 'package:photos/models/backup_status.dart';
import 'package:photos/ui/common/gradient_button.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/delete_file_util.dart';
import 'package:photos/utils/standalone/data.dart';
class FreeSpacePage extends StatefulWidget { class FreeSpacePage extends StatefulWidget {
final BackupStatus status; final BackupStatus status;

View File

@ -10,7 +10,7 @@ import 'package:photos/models/file/trash_file.dart';
import 'package:photos/theme/colors.dart'; import 'package:photos/theme/colors.dart';
import "package:photos/theme/ente_theme.dart"; import "package:photos/theme/ente_theme.dart";
import 'package:photos/ui/sharing/user_avator_widget.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 { class ThumbnailPlaceHolder extends StatelessWidget {
const ThumbnailPlaceHolder({super.key}); const ThumbnailPlaceHolder({super.key});

View File

@ -5,7 +5,7 @@ import "package:native_video_player/native_video_player.dart";
import "package:photos/service_locator.dart"; import "package:photos/service_locator.dart";
import "package:photos/theme/colors.dart"; import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.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 { class SeekBar extends StatefulWidget {
final NativeVideoPlayerController controller; final NativeVideoPlayerController controller;

View File

@ -6,8 +6,8 @@ import "package:photos/models/file/file.dart";
import "package:photos/theme/colors.dart"; import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.dart"; import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/viewer/file/preview_status_widget.dart"; import "package:photos/ui/viewer/file/preview_status_widget.dart";
import "package:photos/utils/date_time_util.dart"; import "package:photos/utils/standalone/date_time.dart";
import "package:photos/utils/debouncer.dart"; import "package:photos/utils/standalone/debouncer.dart";
class VideoWidget extends StatefulWidget { class VideoWidget extends StatefulWidget {
final EnteFile file; final EnteFile file;

View File

@ -19,8 +19,8 @@ import "package:photos/ui/common/loading_widget.dart";
import "package:photos/ui/notification/toast.dart"; import "package:photos/ui/notification/toast.dart";
import "package:photos/ui/viewer/file/video_widget_media_kit_common.dart" import "package:photos/ui/viewer/file/video_widget_media_kit_common.dart"
as common; as common;
import "package:photos/utils/data_util.dart";
import "package:photos/utils/file_util.dart"; import "package:photos/utils/file_util.dart";
import "package:photos/utils/standalone/data.dart";
class VideoWidgetMediaKitPreview extends StatefulWidget { class VideoWidgetMediaKitPreview extends StatefulWidget {
final EnteFile file; final EnteFile file;

View File

@ -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/native_video_player_controls/seek_bar.dart";
import "package:photos/ui/viewer/file/preview_status_widget.dart"; import "package:photos/ui/viewer/file/preview_status_widget.dart";
import "package:photos/ui/viewer/file/thumbnail_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/dialog_util.dart";
import "package:photos/utils/exif_util.dart"; import "package:photos/utils/exif_util.dart";
import "package:photos/utils/file_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"; import "package:visibility_detector/visibility_detector.dart";
class VideoWidgetNative extends StatefulWidget { class VideoWidgetNative extends StatefulWidget {

View File

@ -3,7 +3,7 @@ import "package:intl/intl.dart";
import 'package:photos/models/file/file.dart'; import 'package:photos/models/file/file.dart';
import "package:photos/theme/ente_theme.dart"; import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/info_item_widget.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 { class BackedUpTimeItemWidget extends StatelessWidget {
final EnteFile file; final EnteFile file;

View File

@ -6,8 +6,8 @@ import "package:photos/l10n/l10n.dart";
import 'package:photos/models/file/file.dart'; import 'package:photos/models/file/file.dart';
import "package:photos/theme/ente_theme.dart"; import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/info_item_widget.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/magic_util.dart";
import "package:photos/utils/standalone/date_time.dart";
class CreationTimeItem extends StatefulWidget { class CreationTimeItem extends StatefulWidget {
final EnteFile file; final EnteFile file;

View File

@ -4,10 +4,10 @@ import 'package:photos/models/file/file.dart';
import 'package:photos/models/file/file_type.dart'; import 'package:photos/models/file/file_type.dart';
import "package:photos/theme/ente_theme.dart"; import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/info_item_widget.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/file_util.dart";
import "package:photos/utils/magic_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 { class FilePropertiesItemWidget extends StatefulWidget {
final EnteFile file; final EnteFile file;

View File

@ -6,7 +6,7 @@ import "package:photos/models/file/file_type.dart";
import "package:photos/services/preview_video_store.dart"; import "package:photos/services/preview_video_store.dart";
import "package:photos/theme/ente_theme.dart"; import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/info_item_widget.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 { class PreviewPropertiesItemWidget extends StatefulWidget {
final EnteFile file; final EnteFile file;

View File

@ -3,7 +3,7 @@ import "package:intl/intl.dart";
import "package:photos/core/constants.dart"; import "package:photos/core/constants.dart";
import "package:photos/generated/l10n.dart"; import "package:photos/generated/l10n.dart";
import "package:photos/models/file/file.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 { enum GroupType {
day, day,

View File

@ -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/component/group/type.dart";
import "package:photos/ui/viewer/gallery/gallery.dart"; import "package:photos/ui/viewer/gallery/gallery.dart";
import "package:photos/ui/viewer/gallery/state/gallery_context_state.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"; import "package:scrollable_positioned_list/scrollable_positioned_list.dart";
/* /*

View File

@ -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_context_state.dart";
import "package:photos/ui/viewer/gallery/state/gallery_files_inherited_widget.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/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/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'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
typedef GalleryLoader = Future<FileLoadResult> Function( typedef GalleryLoader = Future<FileLoadResult> Function(

View File

@ -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/applied_filters_for_appbar.dart";
import "package:photos/ui/viewer/hierarchicial_search/recommended_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/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/dialog_util.dart';
import "package:photos/utils/file_download_util.dart"; import "package:photos/utils/file_download_util.dart";
import 'package:photos/utils/magic_util.dart'; import 'package:photos/utils/magic_util.dart';
import 'package:photos/utils/navigation_util.dart'; import 'package:photos/utils/navigation_util.dart';
import 'package:photos/utils/standalone/data.dart';
import "package:uuid/uuid.dart"; import "package:uuid/uuid.dart";
class GalleryAppBarWidget extends StatefulWidget { class GalleryAppBarWidget extends StatefulWidget {

View File

@ -13,8 +13,8 @@ import "package:photos/models/search/search_result.dart";
import "package:photos/services/search_service.dart"; import "package:photos/services/search_service.dart";
import "package:photos/theme/ente_theme.dart"; import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/viewer/search/search_suffix_icon_widget.dart"; import "package:photos/ui/viewer/search/search_suffix_icon_widget.dart";
import "package:photos/utils/date_time_util.dart"; import "package:photos/utils/standalone/date_time.dart";
import "package:photos/utils/debouncer.dart"; import "package:photos/utils/standalone/debouncer.dart";
class SearchWidget extends StatefulWidget { class SearchWidget extends StatefulWidget {
const SearchWidget({super.key}); const SearchWidget({super.key});

View File

@ -19,10 +19,10 @@ import "package:photos/models/ignored_file.dart";
import "package:photos/services/collections_service.dart"; import "package:photos/services/collections_service.dart";
import "package:photos/services/ignored_files_service.dart"; import "package:photos/services/ignored_files_service.dart";
import "package:photos/services/sync/local_sync_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_key.dart";
import "package:photos/utils/file_util.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"); final _logger = Logger("file_download_util");

View File

@ -39,12 +39,12 @@ import 'package:photos/services/collections_service.dart';
import "package:photos/services/preview_video_store.dart"; import "package:photos/services/preview_video_store.dart";
import 'package:photos/services/sync/local_sync_service.dart'; import 'package:photos/services/sync/local_sync_service.dart';
import 'package:photos/services/sync/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/exif_util.dart";
import "package:photos/utils/file_key.dart"; import "package:photos/utils/file_key.dart";
import 'package:photos/utils/file_uploader_util.dart'; import 'package:photos/utils/file_uploader_util.dart';
import "package:photos/utils/file_util.dart"; import "package:photos/utils/file_util.dart";
import "package:photos/utils/network_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:shared_preferences/shared_preferences.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';
import "package:uuid/uuid.dart"; import "package:uuid/uuid.dart";

View File

@ -14,10 +14,10 @@ import "package:photos/models/collection/collection.dart";
import 'package:photos/models/file/file.dart'; import 'package:photos/models/file/file.dart';
import 'package:photos/models/file/file_type.dart'; import 'package:photos/models/file/file_type.dart';
import "package:photos/ui/sharing/show_images_prevew.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/dialog_util.dart';
import 'package:photos/utils/exif_util.dart'; import 'package:photos/utils/exif_util.dart';
import 'package:photos/utils/file_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:receive_sharing_intent/receive_sharing_intent.dart';
import "package:screenshot/screenshot.dart"; import "package:screenshot/screenshot.dart";
import 'package:share_plus/share_plus.dart'; import 'package:share_plus/share_plus.dart';

View File

@ -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.

View File

@ -1,7 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import "package:photos/models/typedefs.dart";
///Do not forget to cancel the debounce's timer using [cancelDebounceTimer] ///Do not forget to cancel the debounce's timer using [cancelDebounceTimer]
///when the debouncer is no longer needed ///when the debouncer is no longer needed
@ -21,7 +20,7 @@ class Debouncer {
final Stopwatch _stopwatch = Stopwatch(); final Stopwatch _stopwatch = Stopwatch();
void run(FutureVoidCallback fn) { void run(Future<void> Function() fn) {
if (leading && !isActive()) { if (leading && !isActive()) {
_stopwatch.stop(); _stopwatch.stop();
_stopwatch.reset(); _stopwatch.reset();

View File

@ -1,7 +1,7 @@
import 'dart:io'; import 'dart:io';
import "package:path/path.dart"; import "package:path/path.dart";
import "package:photos/utils/data_util.dart"; import "package:photos/utils/standalone/data.dart";
class DirectoryStat { class DirectoryStat {
final String path; final String path;

View File

@ -1,6 +1,6 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:photos/core/constants.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'; import 'package:test/test.dart';
void main() { void main() {