updated project style guidelines

This commit is contained in:
2024-04-03 19:18:17 +02:00
parent 27618f4404
commit 4c7f53e309
185 changed files with 505 additions and 873 deletions

View File

@ -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);
}