Answers for "flutter greetings"

0

flutter greetings

String greetingMessage(){

  var timeNow = DateTime.now().hour;
  
  if (timeNow <= 12) {
    return 'Good Morning';
  } else if ((timeNow > 12) && (timeNow <= 16)) {
  return 'Good Afternoon';
  } else if ((timeNow > 16) && (timeNow < 20)) {
  return 'Good Evening';
  } else {
  return 'Good Night';
  }
}
Posted by: Guest on May-20-2021

Browse Popular Code Answers by Language