add mounted check
This commit is contained in:
@@ -226,7 +226,7 @@ class MlDownloadState extends _$MlDownloadState {
|
|||||||
if (progress.status == MlProgressStatus.done) {
|
if (progress.status == MlProgressStatus.done) {
|
||||||
// Keep showing for 2 seconds after completion
|
// Keep showing for 2 seconds after completion
|
||||||
Future.delayed(const Duration(seconds: 2), () {
|
Future.delayed(const Duration(seconds: 2), () {
|
||||||
if (state != null && state!.id == progress.id) {
|
if (ref.mounted && state != null && state!.id == progress.id) {
|
||||||
state = null;
|
state = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ final class MlDownloadStateProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$mlDownloadStateHash() => r'10be3767d448ea8fca8bf35578c343f3b9ddbb4e';
|
String _$mlDownloadStateHash() => r'837e73d9c0f8ac5c25e075417b22ff16cfcdf818';
|
||||||
|
|
||||||
/// Tracks active ML model downloads
|
/// Tracks active ML model downloads
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user