💄 Optimized image loading and error
This commit is contained in:
parent
37f5c61905
commit
d165e488ad
@ -119,7 +119,7 @@ class ProfilePictureWidget extends ConsumerWidget {
|
|||||||
fallbackColor ??
|
fallbackColor ??
|
||||||
Theme.of(context).colorScheme.onPrimaryContainer,
|
Theme.of(context).colorScheme.onPrimaryContainer,
|
||||||
).center()
|
).center()
|
||||||
: CachedNetworkImage(imageUrl: uri, fit: BoxFit.cover),
|
: UniversalImage(uri: uri, fit: BoxFit.cover),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,16 @@ class UniversalImage extends StatelessWidget {
|
|||||||
height: height,
|
height: height,
|
||||||
memCacheHeight: cacheHeight,
|
memCacheHeight: cacheHeight,
|
||||||
memCacheWidth: cacheWidth,
|
memCacheWidth: cacheWidth,
|
||||||
|
progressIndicatorBuilder: (context, url, progress) {
|
||||||
|
return Center(
|
||||||
|
child: CircularProgressIndicator(value: progress.progress),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
errorWidget: (context, url, error) {
|
||||||
|
return const Center(
|
||||||
|
child: Icon(Icons.broken_image, color: Colors.white, size: 16),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user