cpd/lib/database/habit.dart

30 lines
653 B
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.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'] ?? '',
);
}