|
|
|
@ -18,7 +18,10 @@ class ExifBottomSheet extends HookConsumerWidget {
|
|
|
|
const ExifBottomSheet({Key? key, required this.asset}) : super(key: key);
|
|
|
|
const ExifBottomSheet({Key? key, required this.asset}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
bool get hasCoordinates =>
|
|
|
|
bool get hasCoordinates =>
|
|
|
|
asset.exifInfo?.latitude != null && asset.exifInfo?.longitude != null;
|
|
|
|
asset.exifInfo?.latitude != null &&
|
|
|
|
|
|
|
|
asset.exifInfo?.longitude != null &&
|
|
|
|
|
|
|
|
asset.exifInfo!.latitude! != 0 &&
|
|
|
|
|
|
|
|
asset.exifInfo!.longitude! != 0;
|
|
|
|
|
|
|
|
|
|
|
|
String get formattedDateTime {
|
|
|
|
String get formattedDateTime {
|
|
|
|
final fileCreatedAt = asset.fileCreatedAt.toLocal();
|
|
|
|
final fileCreatedAt = asset.fileCreatedAt.toLocal();
|
|
|
|
@ -124,7 +127,7 @@ class ExifBottomSheet extends HookConsumerWidget {
|
|
|
|
? formatBytes(a.exifInfo!.fileSize!)
|
|
|
|
? formatBytes(a.exifInfo!.fileSize!)
|
|
|
|
: "";
|
|
|
|
: "";
|
|
|
|
String text = resolution + fileSize;
|
|
|
|
String text = resolution + fileSize;
|
|
|
|
return text.isEmpty ? null : Text(text);
|
|
|
|
return text.isNotEmpty ? text : null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
buildDragHeader() {
|
|
|
|
buildDragHeader() {
|
|
|
|
@ -207,8 +210,60 @@ class ExifBottomSheet extends HookConsumerWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
buildImageProperties() {
|
|
|
|
|
|
|
|
// Helper to create the ListTile and avoid repeating code
|
|
|
|
|
|
|
|
createImagePropertiesListStyle(title, subtitle) => ListTile(
|
|
|
|
|
|
|
|
contentPadding: const EdgeInsets.all(0),
|
|
|
|
|
|
|
|
dense: true,
|
|
|
|
|
|
|
|
leading: Icon(
|
|
|
|
|
|
|
|
Icons.image,
|
|
|
|
|
|
|
|
color: textColor.withAlpha(200),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
titleAlignment: ListTileTitleAlignment.center,
|
|
|
|
|
|
|
|
title: Text(
|
|
|
|
|
|
|
|
title,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
color: textColor,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
subtitle: subtitle,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final imgSizeString = buildSizeText(asset);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (imgSizeString == null && asset.fileName.isNotEmpty) {
|
|
|
|
|
|
|
|
// There is only filename
|
|
|
|
|
|
|
|
return createImagePropertiesListStyle(
|
|
|
|
|
|
|
|
asset.fileName,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else if (imgSizeString != null && asset.fileName.isNotEmpty) {
|
|
|
|
|
|
|
|
// There is both filename and size information
|
|
|
|
|
|
|
|
return createImagePropertiesListStyle(
|
|
|
|
|
|
|
|
asset.fileName,
|
|
|
|
|
|
|
|
Text(imgSizeString),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else if (imgSizeString != null && asset.fileName.isEmpty) {
|
|
|
|
|
|
|
|
// There is only size information
|
|
|
|
|
|
|
|
return createImagePropertiesListStyle(
|
|
|
|
|
|
|
|
imgSizeString,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
buildDetail() {
|
|
|
|
buildDetail() {
|
|
|
|
|
|
|
|
final imgProperties = buildImageProperties();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// There are no details
|
|
|
|
|
|
|
|
if (imgProperties == null &&
|
|
|
|
|
|
|
|
(exifInfo == null || exifInfo.make == null)) {
|
|
|
|
|
|
|
|
return Container();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -223,22 +278,7 @@ class ExifBottomSheet extends HookConsumerWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
).tr(),
|
|
|
|
).tr(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ListTile(
|
|
|
|
if (imgProperties != null) imgProperties,
|
|
|
|
contentPadding: const EdgeInsets.all(0),
|
|
|
|
|
|
|
|
dense: true,
|
|
|
|
|
|
|
|
leading: Icon(
|
|
|
|
|
|
|
|
Icons.image,
|
|
|
|
|
|
|
|
color: textColor.withAlpha(200),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
title: Text(
|
|
|
|
|
|
|
|
asset.fileName,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
color: textColor,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
subtitle: buildSizeText(asset),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (exifInfo?.make != null)
|
|
|
|
if (exifInfo?.make != null)
|
|
|
|
ListTile(
|
|
|
|
ListTile(
|
|
|
|
contentPadding: const EdgeInsets.all(0),
|
|
|
|
contentPadding: const EdgeInsets.all(0),
|
|
|
|
|