feat: initial commit - Habo habit tracking app
- 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)
This commit is contained in:
31
lib/model/category.dart
Normal file
31
lib/model/category.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
class Category {
|
||||
int? id;
|
||||
String title;
|
||||
int iconCodePoint;
|
||||
String? fontFamily;
|
||||
|
||||
Category({
|
||||
this.id,
|
||||
this.title = '',
|
||||
this.iconCodePoint = 0,
|
||||
this.fontFamily,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'title': title,
|
||||
'iconCodePoint': iconCodePoint,
|
||||
'fontFamily': fontFamily,
|
||||
};
|
||||
}
|
||||
|
||||
factory Category.fromJson(Map<String, dynamic> json) {
|
||||
return Category(
|
||||
id: json['id'] as int?,
|
||||
title: json['title'] as String? ?? '',
|
||||
iconCodePoint: json['iconCodePoint'] as int? ?? 0,
|
||||
fontFamily: json['fontFamily'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user