Skip to content

Commit

Permalink
chore: use loading builder in network image
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Jan 9, 2025
1 parent bb73a45 commit afb21a9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/appflowy_flutter/lib/shared/appflowy_network_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,15 @@ class FlowyNetworkImageState extends State<FlowyNetworkImage> {
if (error is HttpExceptionWithStatus &&
error.statusCode == 404 &&
retryCount < widget.maxRetries) {
return Container(
alignment: Alignment.center,
child: const CircularProgressIndicator(),
);
final fakeDownloadProgress = DownloadProgress(url, null, 0);
return widget.progressIndicatorBuilder?.call(
context,
url,
fakeDownloadProgress,
) ??
const Center(
child: CircularProgressIndicator(),
);
}

// Default error widget behavior
Expand Down

0 comments on commit afb21a9

Please sign in to comment.