Time constructor
Time({})
Implementation
Time(
{String? code,
String? day,
String? hour,
String? minute,
int? year,
int? month,
DateTime? time})
: super(code) {
if (time != null) {
_time = time;
} else {
final today = DateTime.now().toUtc();
year ??= today.year;
month ??= today.month;
day ??= '01';
hour ??= '00';
minute ??= '00';
final monthStr = '$month'.padLeft(2, '0');
final generatedDate = '$year$monthStr${day}T$hour${minute}00';
_time = DateTime.parse(generatedDate);
}
}