isBefore method

bool isBefore(
  1. TimeOfDay other
)

Returns true if this time occurs before other.

The comparison is independent of whether the time is in UTC or in the local time zone.

Implementation

bool isBefore(TimeOfDay other) =>
    DateTime(2021, 1, 1, hour, minute, second).isBefore(DateTime(2021, 1, 1, other.hour, other.minute, other.second));