updated project style guidelines
This commit is contained in:
@ -1,30 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
extension IsSameDay on DateTime {
|
||||
bool isSameDay(DateTime other) {
|
||||
return year == other.year && month == other.month && day == other.day;
|
||||
}
|
||||
bool isSameDay(DateTime other) => year == other.year && month == other.month && day == other.day;
|
||||
|
||||
DateTime nextWeekday(int day) {
|
||||
return add(Duration(days: (day - weekday) % DateTime.daysPerWeek));
|
||||
}
|
||||
DateTime nextWeekday(int day) => add(Duration(days: (day - weekday) % DateTime.daysPerWeek));
|
||||
|
||||
DateTime withTime(TimeOfDay time) {
|
||||
return copyWith(hour: time.hour, minute: time.minute);
|
||||
}
|
||||
DateTime withTime(TimeOfDay time) => copyWith(hour: time.hour, minute: time.minute);
|
||||
|
||||
TimeOfDay toTimeOfDay() {
|
||||
return TimeOfDay(hour: hour, minute: minute);
|
||||
}
|
||||
TimeOfDay toTimeOfDay() => TimeOfDay(hour: hour, minute: minute);
|
||||
|
||||
bool isSameDateTime(DateTime other) {
|
||||
bool isSameDay = this.isSameDay(other);
|
||||
bool isSameTimeOfDay = (toTimeOfDay() == other.toTimeOfDay());
|
||||
var isSameDay = this.isSameDay(other);
|
||||
var isSameTimeOfDay = (toTimeOfDay() == other.toTimeOfDay());
|
||||
|
||||
return isSameDay && isSameTimeOfDay;
|
||||
}
|
||||
|
||||
bool isSameOrAfter(DateTime other) {
|
||||
return isSameDateTime(other) || isAfter(other);
|
||||
}
|
||||
}
|
||||
bool isSameOrAfter(DateTime other) => isSameDateTime(other) || isAfter(other);
|
||||
}
|
||||
|
Reference in New Issue
Block a user