show method

dynamic show(
  1. String title,
  2. String message,
  3. TypeAlert type, [
  4. Map<String, dynamic>? payload,
])

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();
      });
    }
  }
}