migrating...
This commit is contained in:
@ -6,7 +6,23 @@ ImageProvider findMediaByType(List<MediaItem> media, MediaType type) {
|
||||
Image image;
|
||||
|
||||
if (found.isNotEmpty) {
|
||||
image = Image.network(found.first.reference);
|
||||
image = Image.network('https://test.com/image.jpg', loadingBuilder:
|
||||
(BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {
|
||||
print('loading');
|
||||
print(loadingProgress);
|
||||
if (loadingProgress == null) return child;
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
value: loadingProgress.expectedTotalBytes != null
|
||||
? loadingProgress.cumulativeBytesLoaded /
|
||||
loadingProgress.expectedTotalBytes!
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}, errorBuilder: (context, error, stackTrace) {
|
||||
print('error');
|
||||
return Image.asset('assets/images/placeholder.jpg');
|
||||
});
|
||||
} else {
|
||||
// Element is not found
|
||||
image = Image.asset('assets/images/placeholder.jpg');
|
||||
|
Reference in New Issue
Block a user