showSequencialToasts function

Future<void> showSequencialToasts(
  1. {required List<Toast> toasts,
  2. required BuildContext context}
)

Show one toast after another finished

Implementation

Future<void> showSequencialToasts({
  required List<Toast> toasts,
  required BuildContext context,
}) async {
  for (var toast in toasts) {
    assert(
      toast.duration != null,
      'To show sequencial toasts, the toast duration can NOT be null',
    );
    await showToastWidget(
      toast: toast,
      context: context,
    );
  }
}