|
@@ -7,6 +7,7 @@ import "package:photos/ente_theme_data.dart";
|
|
|
import "package:photos/models/file.dart";
|
|
|
import "package:photos/models/file_type.dart";
|
|
|
import "package:photos/services/collections_service.dart";
|
|
|
+import 'package:photos/ui/viewer/file/RawExifButton.dart';
|
|
|
import "package:photos/ui/viewer/file/exif_info_dialog.dart";
|
|
|
import "package:photos/utils/date_time_util.dart";
|
|
|
import "package:photos/utils/exif_util.dart";
|
|
@@ -58,6 +59,12 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
final file = widget.file;
|
|
|
+ print('file');
|
|
|
+ print(file);
|
|
|
+ print("file.localID");
|
|
|
+ print(file.localID);
|
|
|
+ print("file.duration");
|
|
|
+ print(file.duration);
|
|
|
final dateTime = DateTime.fromMicrosecondsSinceEpoch(file.creationTime);
|
|
|
final dateTimeForUpdationTime =
|
|
|
DateTime.fromMicrosecondsSinceEpoch(file.updationTime);
|
|
@@ -127,7 +134,10 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
|
|
|
padding: const EdgeInsets.only(right: 10),
|
|
|
child: _getFileSize(),
|
|
|
),
|
|
|
- !_isImage ? _getVideoDuration() : const SizedBox.shrink(),
|
|
|
+ (file.fileType == FileType.video) &&
|
|
|
+ (file.localID != null || file.duration != 0)
|
|
|
+ ? _getVideoDuration()
|
|
|
+ : const SizedBox.shrink(),
|
|
|
],
|
|
|
),
|
|
|
trailing: file.uploadedFileID == null ||
|
|
@@ -399,94 +409,3 @@ class DividerWithPadding extends StatelessWidget {
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-enum Status {
|
|
|
- loading,
|
|
|
- exifIsAvailable,
|
|
|
- noExif,
|
|
|
-}
|
|
|
-
|
|
|
-class RawExifButton extends StatelessWidget {
|
|
|
- final File file;
|
|
|
- final Map<String, IfdTag> exif;
|
|
|
- const RawExifButton(this.exif, this.file, {Key key}) : super(key: key);
|
|
|
-
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- Status exifStatus = Status.loading;
|
|
|
- if (exif == null) {
|
|
|
- exifStatus = Status.loading;
|
|
|
- } else if (exif.isNotEmpty) {
|
|
|
- exifStatus = Status.exifIsAvailable;
|
|
|
- } else {
|
|
|
- exifStatus = Status.noExif;
|
|
|
- }
|
|
|
- return GestureDetector(
|
|
|
- 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,
|
|
|
- child: Container(
|
|
|
- height: 40,
|
|
|
- width: 140,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Theme.of(context)
|
|
|
- .colorScheme
|
|
|
- .inverseBackgroundColor
|
|
|
- .withOpacity(0.12),
|
|
|
- borderRadius: const BorderRadius.all(
|
|
|
- Radius.circular(20),
|
|
|
- ),
|
|
|
- ),
|
|
|
- child: Center(
|
|
|
- child: exifStatus == Status.loading
|
|
|
- ? Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: const [
|
|
|
- CupertinoActivityIndicator(
|
|
|
- radius: 8,
|
|
|
- ),
|
|
|
- SizedBox(
|
|
|
- width: 8,
|
|
|
- ),
|
|
|
- Text('EXIF')
|
|
|
- ],
|
|
|
- )
|
|
|
- : exifStatus == Status.exifIsAvailable
|
|
|
- ? Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: const [
|
|
|
- Icon(Icons.feed_outlined),
|
|
|
- SizedBox(
|
|
|
- width: 8,
|
|
|
- ),
|
|
|
- Text('Raw EXIF'),
|
|
|
- ],
|
|
|
- )
|
|
|
- : Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: const [
|
|
|
- Icon(Icons.feed_outlined),
|
|
|
- SizedBox(
|
|
|
- width: 8,
|
|
|
- ),
|
|
|
- Text('No EXIF'),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- );
|
|
|
- }
|
|
|
-}
|