метод compareTo
- Duration other
override
Сравнивает этот Duration с other, возвращая ноль, если значения равны.
Возвращает отрицательное целое число, если этот Duration короче, чем other, или положительное целое число, если он длиннее.
Отрицательный Duration всегда считается короче положительного.
Всегда верно, что duration1.compareTo(duration2) < 0 тогда и только тогда, когда (someDate + duration1).compareTo(someDate + duration2) < 0.
Реализация
int compareTo(Duration other) => _duration.compareTo(other._duration);
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.19.6/dart-core/Duration/compareTo.html