asPreviewWidget method
Implementation
@override
Widget asPreviewWidget() {
if (!kIsWeb) {
return Image.file(
File(
imageFile.path,
),
);
}
return Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Flexible(
child: RepaintBoundary(
key: _renderRepaintKey,
child: Stack(
alignment: Alignment.bottomRight,
children: [
Image.network(
imageFile.path,
),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateFormat('dd MMM, yyyy HH:mm').format(dateTime),
textAlign: TextAlign.end,
style: const TextStyle(fontSize: 16, color: Colors.red),
),
if (locationData != null)
Text(
'${locationData!.longitude}, ${locationData!.latitude}',
textAlign: TextAlign.end,
style: const TextStyle(fontSize: 16, color: Colors.red),
),
],
)
],
),
),
),
],
);
}