addFail method
Implementation
void addFail(ProgressItem progress) {
_fails.add(progress);
if (removeFailAfterDuration) {
bool reRun = false;
var timer = Timer.periodic(const Duration(milliseconds: 100), (timer) {
if (!_fails.any((element) => element == progress)) {
reRun = true;
timer.cancel();
}
});
Future.delayed(_failDuration).then((value) {
if (timer.isActive) {
timer.cancel();
}
if (!reRun) {
removeFail(progress);
}
});
}
update();
}