migrating...
This commit is contained in:
@ -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(
|
||||
|
Reference in New Issue
Block a user