migrating...

This commit is contained in:
Joshua Burman
2025-04-15 15:29:55 -04:00
parent bdc4fee8c2
commit de22d62432
22 changed files with 17610 additions and 1873 deletions

View File

@ -17,19 +17,45 @@ class MediaCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
DecorationImage mediaImage(MediaItem media) {
dynamic image;
mediaImage(MediaItem media) {
Image image = Image.asset('assets/images/placeholder.jpg');
if (media.type == MediaType.image || media.type == MediaType.location) {
image = NetworkImage(media.reference);
image = Image.network(media.reference, loadingBuilder:
(BuildContext context, Widget child,
ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) return child;
return Text('WTF!!!!');
// return Center(
// child: CircularProgressIndicator(
// value: loadingProgress.expectedTotalBytes != null
// ? loadingProgress.cumulativeBytesLoaded /
// loadingProgress.expectedTotalBytes!
// : null,
// ),
// );
});
} else if (media.type == MediaType.localImage) {
image = Image.memory(base64Decode(media.reference)).image;
image = Image.memory(base64Decode(media.reference));
} else if (media.type == MediaType.youtube) {
image =
NetworkImage('https://img.youtube.com/vi/${media.reference}/0.jpg');
} else if (media.type == MediaType.localVideo) {}
Image.network('https://img.youtube.com/vi/${media.reference}/0.jpg',
loadingBuilder: (BuildContext context, Widget child,
ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) return child;
return Text('WTF!!!!');
// return Center(
// child: CircularProgressIndicator(
// value: loadingProgress.expectedTotalBytes != null
// ? loadingProgress.cumulativeBytesLoaded /
// loadingProgress.expectedTotalBytes!
// : null,
// ),
// );
});
} //else if (media.type == MediaType.localVideo) {}
return DecorationImage(image: image, fit: BoxFit.cover);
return DecorationImage(image: image.image, fit: BoxFit.cover);
}
return Container(