show method
Implementation
show(String title, String message, TypeAlert type,
[Map<String, dynamic>? payload]) {
final delay = getDelay();
if (!_animationController!.isDismissed) {
cancelTimerRelay();
cancelTimer();
_animationController!.reverse();
_timerRelay = Timer(Duration(milliseconds: getDuration()), () {
setState(() {
this.title = title;
this.message = message;
this.type = type;
this.payload = payload ?? null;
});
_animationController!.forward();
if (delay != null) {
_timer = Timer(Duration(milliseconds: delay), () {
_animationController!.reverse();
});
}
});
} else {
setState(() {
this.title = title;
this.message = message;
this.type = type;
this.payload = payload ?? null;
});
_animationController!.forward();
if (delay != null) {
_timer = Timer(Duration(milliseconds: delay), () {
_animationController!.reverse();
});
}
}
}