📜  颤振问候 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:35.133000             🧑  作者: Mango

代码示例1
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';
  }
}