Selaa lähdekoodia

added ontap for different states of raw exif button

ashilkn 3 vuotta sitten
vanhempi
commit
fe3daeba0c
2 muutettua tiedostoa jossa 28 lisäystä ja 5 poistoa
  1. 19 3
      lib/ui/viewer/file/file_info_dialog.dart
  2. 9 2
      pubspec.lock

+ 19 - 3
lib/ui/viewer/file/file_info_dialog.dart

@@ -238,7 +238,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
           ? Padding(
               padding: const EdgeInsets.fromLTRB(0, 24, 0, 16),
               child: SafeArea(
-                child: RawExifButton(_exif),
+                child: RawExifButton(_exif, widget.file),
               ),
             )
           : const SizedBox(
@@ -766,8 +766,9 @@ enum Status {
 }
 
 class RawExifButton extends StatelessWidget {
+  final File file;
   final Map<String, IfdTag> exif;
-  const RawExifButton(this.exif, {Key key}) : super(key: key);
+  const RawExifButton(this.exif, this.file, {Key key}) : super(key: key);
 
   @override
   Widget build(BuildContext context) {
@@ -829,7 +830,22 @@ class RawExifButton extends StatelessWidget {
                     ),
         ),
       ),
-      onTap: () {},
+      onTap:
+          exifStatus == Status.loading || exifStatus == Status.exifIsAvailable
+              ? () {
+                  showDialog(
+                    context: context,
+                    builder: (BuildContext context) {
+                      return ExifInfoDialog(file);
+                    },
+                    barrierColor: Colors.black87,
+                  );
+                }
+              : exifStatus == Status.noExif
+                  ? () {
+                      showShortToast(context, "This image has no exif data");
+                    }
+                  : null,
     );
   }
 }

+ 9 - 2
pubspec.lock

@@ -137,7 +137,7 @@ packages:
     source: hosted
     version: "1.1.0"
   collection:
-    dependency: transitive
+    dependency: "direct main"
     description:
       name: collection
       url: "https://pub.dartlang.org"
@@ -809,6 +809,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "3.2.1"
+  open_mail_app:
+    dependency: "direct main"
+    description:
+      name: open_mail_app
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.4.5"
   package_info_plus:
     dependency: "direct main"
     description:
@@ -866,7 +873,7 @@ packages:
     source: hosted
     version: "0.2.0"
   path:
-    dependency: transitive
+    dependency: "direct main"
     description:
       name: path
       url: "https://pub.dartlang.org"