isThisHour method

bool isThisHour([
  1. DateTime? dateTime
])

Returns true if the time is the same as a specific dateTime or the current time.

特定のdateTimeもしくは現在時間と同じ時刻の場合はtrueを返します。

Implementation

bool isThisHour([DateTime? dateTime]) {
  dateTime ??= DateTime.now();
  return year == dateTime.year &&
      month == dateTime.month &&
      day == dateTime.day &&
      hour == dateTime.hour;
}