flashMessage method

Future flashMessage(
  1. String reason,
  2. dynamic message
)

Implementation

Future flashMessage(String reason, var message) async {

  if(reason.isNotEmpty && message!=''){
    final cookie = Cookie(reason, message.toString());
    DateTime now = new DateTime.now().toLocal();
    DateTime date = new DateTime(now.year, now.month, now.day, now.hour, now.minute, now.second, now.microsecond+1000);
    cookie.httpOnly = false;
    cookie.expires = date;
    res?.cookies.add(cookie);
  }else{
    throw CustomException('[ Error ] Either one of two data is not supplied!').showError();
  }
}