isAfter method Null safety
- DateTime other
Returns true if this occurs after other
.
The comparison is independent of whether the time is in UTC or in the local time zone.
var now = DateTime.now();
var later = now.add(const Duration(seconds: 5));
assert(later.isAfter(now));
assert(!now.isBefore(now));
// This relation stays the same, even when changing timezones.
assert(later.isAfter(now.toUtc()));
assert(later.toUtc().isAfter(now));
assert(!now.toUtc().isAfter(now));
assert(!now.isAfter(now.toUtc()));
Implementation
external bool isAfter(DateTime other);