showToast method

Future showToast(
  1. String msg
)

Implementation

Future showToast(String msg) async {
  _toastNumber++;
  toastMsg = msg;
  notifyListeners();
  await Future.delayed(showDuration);
  toastMsg = null;
  _toastNumber--;
  notifyListeners();
}