what I did:
extension BigDate on DateTime {
String get locatedWeekDay {
switch (weekday) {
case DateTime.sunday:
return "Sun";
case DateTime.monday:
return "Mon";
case DateTime.tuesday:
return "Tue";
......
default:
throw Exception();
}
}
}
class JapanDate extends DateTime {
@override
String get locatedWeekDay {
switch (weekday) {
case DateTime.sunday:
return "日";
case DateTime.monday:
return "月";
......
default:
throw Exception();
}
}
}
now I just run this:
DateTime d = JapanDate(2022, 3, 2);
print(d.locatedWeekDay);
it returns me "Wed" oh, can you help me to fix it?
I tried: to add @override to the get method, add the import to the first line.