2024-05-12 00:08:54 +02:00
|
|
|
|
|
|
|
class Habit {
|
|
|
|
final int id;
|
|
|
|
bool isComplete;
|
|
|
|
String title;
|
|
|
|
String? subtitle;
|
2024-05-12 17:56:36 +02:00
|
|
|
//IconData icon;
|
2024-05-12 00:08:54 +02:00
|
|
|
|
|
|
|
Habit({
|
|
|
|
required this.id,
|
|
|
|
required this.isComplete,
|
|
|
|
required this.title,
|
|
|
|
this.subtitle,
|
2024-05-12 17:56:36 +02:00
|
|
|
//required this.icon,
|
2024-05-12 00:08:54 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
factory Habit.fromSqfliteDatabase(Map<String, dynamic> map) => Habit(
|
2024-05-12 17:56:36 +02:00
|
|
|
id: map['id']?.toInt(),
|
|
|
|
isComplete: map['isComplete'] == 1,
|
|
|
|
title: map['title'],
|
2024-05-12 00:08:54 +02:00
|
|
|
subtitle: map['subtitle'] ?? '',
|
2024-05-12 17:56:36 +02:00
|
|
|
//icon: const IconData(0xe800, fontFamily: 'MyCustomFont')
|
2024-05-12 00:08:54 +02:00
|
|
|
//icon: map['icon'] ?? '',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|