فهرست منبع

change name of file and widget used to update location data

ashilkn 1 سال پیش
والد
کامیت
a1d4873e88
2فایلهای تغییر یافته به همراه11 افزوده شده و 8 حذف شده
  1. 2 2
      lib/ui/viewer/file/file_details_widget.dart
  2. 9 6
      lib/ui/viewer/location/update_location_data_widget.dart

+ 2 - 2
lib/ui/viewer/file/file_details_widget.dart

@@ -24,7 +24,7 @@ import 'package:photos/ui/viewer/file_details/exif_item_widgets.dart';
 import "package:photos/ui/viewer/file_details/file_properties_item_widget.dart";
 import "package:photos/ui/viewer/file_details/location_tags_widget.dart";
 import "package:photos/ui/viewer/file_details/objects_item_widget.dart";
-import 'package:photos/ui/viewer/location/add_location_data_widget.dart';
+import 'package:photos/ui/viewer/location/update_location_data_widget.dart';
 import "package:photos/utils/exif_util.dart";
 
 class FileDetailsWidget extends StatefulWidget {
@@ -188,7 +188,7 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
                           barrierColor: backdropFaintDark,
                           context: context,
                           builder: (context) {
-                            return const AddLocationDataWidget();
+                            return UpdateLocationDataWidget([file]);
                           },
                         );
                       },

+ 9 - 6
lib/ui/viewer/location/add_location_data_widget.dart → lib/ui/viewer/location/update_location_data_widget.dart

@@ -1,17 +1,20 @@
 import "package:flutter/material.dart";
 import "package:flutter_map/flutter_map.dart";
 import "package:latlong2/latlong.dart";
+import "package:photos/models/file/file.dart";
 import "package:photos/ui/map/map_button.dart";
 import "package:photos/ui/map/tile/layers.dart";
 
-class AddLocationDataWidget extends StatefulWidget {
-  const AddLocationDataWidget({super.key});
+class UpdateLocationDataWidget extends StatefulWidget {
+  final List<EnteFile> files;
+  const UpdateLocationDataWidget(this.files, {super.key});
 
   @override
-  State<AddLocationDataWidget> createState() => _AddLocationDataWidgetState();
+  State<UpdateLocationDataWidget> createState() =>
+      _UpdateLocationDataWidgetState();
 }
 
-class _AddLocationDataWidgetState extends State<AddLocationDataWidget> {
+class _UpdateLocationDataWidgetState extends State<UpdateLocationDataWidget> {
   final MapController _mapController = MapController();
   LatLng? selectedLocation;
   ValueNotifier hasSelectedLocation = ValueNotifier(false);
@@ -24,7 +27,7 @@ class _AddLocationDataWidgetState extends State<AddLocationDataWidget> {
   @override
   void dispose() {
     super.dispose();
-
+    hasSelectedLocation.dispose();
     _mapController.dispose();
   }
 
@@ -69,7 +72,7 @@ class _AddLocationDataWidgetState extends State<AddLocationDataWidget> {
                 icon: Icons.check,
 
                 onPressed: () {},
-                heroTag: 'zoom-in',
+                heroTag: 'add-location',
               ),
               const SizedBox(height: 16),
               MapButton(