Browse Source

create UI of row in file info to add location data manually when location data is absent

ashilkn 1 year ago
parent
commit
ddcd3c6099
1 changed files with 22 additions and 2 deletions
  1. 22 2
      lib/ui/viewer/file/file_details_widget.dart

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

@@ -11,6 +11,7 @@ import "package:photos/services/update_service.dart";
 import 'package:photos/theme/ente_theme.dart';
 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/divider_widget.dart";
 import "package:photos/ui/components/divider_widget.dart";
+import "package:photos/ui/components/info_item_widget.dart";
 import 'package:photos/ui/components/title_bar_widget.dart';
 import 'package:photos/ui/components/title_bar_widget.dart';
 import 'package:photos/ui/viewer/file/file_caption_widget.dart';
 import 'package:photos/ui/viewer/file/file_caption_widget.dart';
 import "package:photos/ui/viewer/file_details/added_by_widget.dart";
 import "package:photos/ui/viewer/file_details/added_by_widget.dart";
@@ -157,7 +158,25 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
                     const FileDetailsDivider(),
                     const FileDetailsDivider(),
                   ],
                   ],
                 )
                 )
-              : const SizedBox.shrink();
+              : Column(
+                  children: [
+                    InfoItemWidget(
+                      leadingIcon: Icons.pin_drop_outlined,
+                      title: "No location data",
+                      subtitleSection: Future.value(
+                        [
+                          Text(
+                            "Add location data",
+                            style: getEnteTextTheme(context).miniBoldMuted,
+                          ),
+                        ],
+                      ),
+                      hasChipButtons: false,
+                      onTap: () {},
+                    ),
+                    const FileDetailsDivider(),
+                  ],
+                );
         },
         },
       ),
       ),
     ]);
     ]);
@@ -280,7 +299,8 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
     if (imageWidth != null && imageLength != null) {
     if (imageWidth != null && imageLength != null) {
       _exifData["resolution"] = '$imageWidth x $imageLength';
       _exifData["resolution"] = '$imageWidth x $imageLength';
       final double megaPixels =
       final double megaPixels =
-          (imageWidth.values.firstAsInt() * imageLength.values.firstAsInt()) / 1000000;
+          (imageWidth.values.firstAsInt() * imageLength.values.firstAsInt()) /
+              1000000;
       final double roundedMegaPixels = (megaPixels * 10).round() / 10.0;
       final double roundedMegaPixels = (megaPixels * 10).round() / 10.0;
       _exifData['megaPixels'] = roundedMegaPixels..toStringAsFixed(1);
       _exifData['megaPixels'] = roundedMegaPixels..toStringAsFixed(1);
     } else {
     } else {