Skip to content

Commit

Permalink
Fix image loading indicator (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo authored Jan 24, 2024
1 parent a574954 commit 3efdb52
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions lib/shared/image_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,15 @@ class _ImageViewerState extends State<ImageViewer> with TickerProviderStateMixin

animationController.forward();
},
loadStateChanged: (state) {
if (state.extendedImageLoadState == LoadState.loading) {
return Center(
child: CircularProgressIndicator(
color: Colors.white.withOpacity(0.90),
),
);
}
},
)
: ExtendedImage.memory(
widget.bytes!,
Expand Down Expand Up @@ -345,16 +354,21 @@ class _ImageViewerState extends State<ImageViewer> with TickerProviderStateMixin

animationController.forward();
},
loadStateChanged: (state) {
if (state.extendedImageLoadState == LoadState.loading) {
return Center(
child: CircularProgressIndicator(
color: Colors.white.withOpacity(0.90),
),
);
}
},
),
),
)
: Center(
child: SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
color: Colors.white.withOpacity(0.90),
),
child: CircularProgressIndicator(
color: Colors.white.withOpacity(0.90),
),
)),
),
Expand Down

0 comments on commit 3efdb52

Please sign in to comment.