增加loadingProgress参数,用于显示进度。
ExtendedImage.network(
‘https://raw.githubusercontent.com/fluttercandies/flutter_candies/master/gif/extended_text/special_text.jpg’,
handleLoadingProgress: true,
clearMemoryCacheIfFailed: true,
clearMemoryCacheWhenDispose: true,
cache: false,
loadStateChanged: (ExtendedImageState state) {
if (state.extendedImageLoadState == LoadState.loading) {
final loadingProgress = state.loadingProgress;
final progress = loadingProgress?.expectedTotalBytes != null
? loadingProgress.cumulativeBytesLoaded /
-
loadingProgress.expectedTotalBytes
- null;
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 150.0,
child: LinearProgressIndicator(
<