Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Refactor showPickCenterPointSheet to return just the center point of the file chosen instead of the whole file

ashilkn86a67b37c193
diff --git a/lib/ui/viewer/location/edit_center_point_tile_widget.dart b/lib/ui/viewer/location/edit_center_point_tile_widget.dart
index 99697d74cf..25d202114b 100644
--- a/lib/ui/viewer/location/edit_center_point_tile_widget.dart
+++ b/lib/ui/viewer/location/edit_center_point_tile_widget.dart
@@ -1,6 +1,6 @@
import "package:flutter/material.dart";
import "package:photos/generated/l10n.dart";
-import 'package:photos/models/file/file.dart';
+import "package:photos/models/location/location.dart";
import "package:photos/services/location_service.dart";
import "package:photos/states/location_state.dart";
import "package:photos/theme/ente_theme.dart";
@@ -50,13 +50,13 @@ class EditCenterPointTileWidget extends StatelessWidget {
),
IconButtonWidget(
onTap: () async {
- final EnteFile? centerPointFile = await showPickCenterPointSheet(
+ final Location? centerPoint = await showPickCenterPointSheet(
context,
InheritedLocationTagData.of(context).locationTagEntity!.item.name,
);
- if (centerPointFile != null) {
+ if (centerPoint != null) {
InheritedLocationTagData.of(context)
- .updateCenterPoint(centerPointFile.location!);
+ .updateCenterPoint(centerPoint);
}
},
icon: Icons.edit,
diff --git a/lib/ui/viewer/location/pick_center_point_widget.dart b/lib/ui/viewer/location/pick_center_point_widget.dart
index 1674f74375..ddde018ec7 100644
--- a/lib/ui/viewer/location/pick_center_point_widget.dart
+++ b/lib/ui/viewer/location/pick_center_point_widget.dart
@@ -7,8 +7,8 @@ import "package:photos/core/event_bus.dart";
import "package:photos/db/files_db.dart";
import "package:photos/events/local_photos_updated_event.dart";
import "package:photos/generated/l10n.dart";
-import 'package:photos/models/file/file.dart';
import "package:photos/models/file_load_result.dart";
+import "package:photos/models/location/location.dart";
import "package:photos/models/selected_files.dart";
import "package:photos/services/collections_service.dart";
import "package:photos/services/filter/db_filters.dart";
@@ -20,7 +20,7 @@ import "package:photos/ui/components/models/button_type.dart";
import "package:photos/ui/components/title_bar_title_widget.dart";
import "package:photos/ui/viewer/gallery/gallery.dart";
-Future<EnteFile?> showPickCenterPointSheet(
+Future<Location?> showPickCenterPointSheet(
BuildContext context,
String? locationTagName,
) async {
@@ -143,9 +143,9 @@ class PickCenterPointWidget extends StatelessWidget {
buttonType: ButtonType.neutral,
labelText: S.of(context).useSelectedPhoto,
onTap: () async {
- final selectedFile =
- selectedFiles.files.first;
- Navigator.pop(context, selectedFile);
+ final selectedLocation =
+ selectedFiles.files.first.location;
+ Navigator.pop(context, selectedLocation);
},
),
);