15 lines
393 B
Dart
15 lines
393 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
extension TimeOfDayExt on TimeOfDay {
|
|
bool isBefore(TimeOfDay other) {
|
|
return hour < other.hour && minute < other.minute;
|
|
}
|
|
|
|
bool isAfter(TimeOfDay other) {
|
|
return hour > other.hour && minute > other.minute;
|
|
}
|
|
|
|
TimeOfDay add({int hours = 0, int minutes = 0}) {
|
|
return replacing(hour: hour + hours, minute: minute + minutes);
|
|
}
|
|
} |