import 'package:flutter/cupertino.dart'; import 'package:flutter/material.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 map) => Habit( id: map['id']?.toInt() ?? 0, isComplete: map['isComplete'] ?? false, title: map['title'] ?? '', subtitle: map['subtitle'] ?? '', icon: IconData(int.parse(map['icon']), fontFamily: 'MaterialIcons'), //icon: map['icon'] ?? '', ); }