Skip to content

armgit / ente

Public Imported from GitHub
0

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

Refactor showPickCenterPointSheet to accept name of location tag instead of the entire locationTagEntity object

ashilknce5665f0dda1
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 169dc825dd..99697d74cf 100644
--- a/lib/ui/viewer/location/edit_center_point_tile_widget.dart
+++ b/lib/ui/viewer/location/edit_center_point_tile_widget.dart
@@ -52,7 +52,7 @@ class EditCenterPointTileWidget extends StatelessWidget {
onTap: () async {
final EnteFile? centerPointFile = await showPickCenterPointSheet(
context,
- InheritedLocationTagData.of(context).locationTagEntity!,
+ InheritedLocationTagData.of(context).locationTagEntity!.item.name,
);
if (centerPointFile != null) {
InheritedLocationTagData.of(context)
diff --git a/lib/ui/viewer/location/pick_center_point_widget.dart b/lib/ui/viewer/location/pick_center_point_widget.dart
index 7f7269aee4..1674f74375 100644
--- a/lib/ui/viewer/location/pick_center_point_widget.dart
+++ b/lib/ui/viewer/location/pick_center_point_widget.dart
@@ -9,8 +9,6 @@ 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/local_entity_data.dart";
-import "package:photos/models/location_tag/location_tag.dart";
import "package:photos/models/selected_files.dart";
import "package:photos/services/collections_service.dart";
import "package:photos/services/filter/db_filters.dart";
@@ -24,12 +22,12 @@ import "package:photos/ui/viewer/gallery/gallery.dart";
Future<EnteFile?> showPickCenterPointSheet(
BuildContext context,
- LocalEntity<LocationTag> locationTagEntity,
+ String? locationTagName,
) async {
return await showBarModalBottomSheet(
context: context,
builder: (context) {
- return PickCenterPointWidget(locationTagEntity);
+ return PickCenterPointWidget(locationTagName);
},
shape: const RoundedRectangleBorder(
side: BorderSide(width: 0),
@@ -45,10 +43,10 @@ Future<EnteFile?> showPickCenterPointSheet(
}
class PickCenterPointWidget extends StatelessWidget {
- final LocalEntity<LocationTag> locationTagEntity;
+ final String? locationTagName;
const PickCenterPointWidget(
- this.locationTagEntity, {
+ this.locationTagName, {
super.key,
});
@@ -81,7 +79,7 @@ class PickCenterPointWidget extends StatelessWidget {
title: TitleBarTitleWidget(
title: S.of(context).pickCenterPoint,
),
- caption: locationTagEntity.item.name,
+ caption: locationTagName,
),
Expanded(
child: Gallery(