cpd/lib/database/habit.dart

27 lines
533 B
Dart

class Habit {
final int id;
bool isComplete;
String title;
String? subtitle;
//IconData icon;
Habit({
required this.id,
required this.isComplete,
required this.title,
this.subtitle,
//required this.icon,
});
factory Habit.fromSqfliteDatabase(Map<String, dynamic> map) => Habit(
id: map['id']?.toInt(),
isComplete: map['isComplete'] == 1,
title: map['title'],
subtitle: map['subtitle'] ?? '',
//icon: const IconData(0xe800, fontFamily: 'MyCustomFont')
//icon: map['icon'] ?? '',
);
}