- Complete MVP with Repository Pattern, SQLite storage - Provider + ChangeNotifier state management - Navigation 2.0 with deep link support - Habit CRUD with twoDayRule, notifications, categories - Backup/Restore via JSON - Statistics with streak tracking - Material You theme support - Biometric lock support - Desktop widget support - 27 languages i18n structure - Comprehensive test suite (87/89 passing)
20 lines
665 B
Dart
20 lines
665 B
Dart
String dayOfWeek(int day) {
|
|
const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
if (day >= 1 && day <= 7) return days[day - 1];
|
|
return '';
|
|
}
|
|
|
|
String monthName(int month) {
|
|
const months = ['January', 'February', 'March', 'April', 'May', 'June',
|
|
'July', 'August', 'September', 'October', 'November', 'December'];
|
|
if (month >= 1 && month <= 12) return months[month - 1];
|
|
return '';
|
|
}
|
|
|
|
String formatTimeOfDay(int hour, int minute) {
|
|
final period = hour >= 12 ? 'PM' : 'AM';
|
|
final h = hour > 12 ? hour - 12 : (hour == 0 ? 12 : hour);
|
|
final m = minute.toString().padLeft(2, '0');
|
|
return '$h:$m $period';
|
|
}
|