Skip to content

Commit

Permalink
Fix media preview delete image error
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-pratik-k committed Dec 13, 2024
1 parent e92d8e1 commit 38d46bb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ class NetworkImagePreviewStateNotifier
}

@override
void dispose() {
tempFile?.deleteSync();
Future<void> dispose() async {
if (tempFile != null && await tempFile!.exists()) {
await tempFile!.delete();
}
cancelToken?.cancel();
super.dispose();
}
Expand Down

0 comments on commit 38d46bb

Please sign in to comment.