24 lines
500 B
Dart
24 lines
500 B
Dart
import 'package:smoke_cess_app/interface/db_record.dart';
|
|
|
|
class Mood implements DatabaseRecord {
|
|
final double _moodValue;
|
|
final String _comment;
|
|
final DateTime _date;
|
|
|
|
Mood(this._moodValue, this._comment, this._date);
|
|
|
|
@override
|
|
String toCSV() {
|
|
return "${_date.toIso8601String()}, ${_moodValue.round().toString()}, $_comment";
|
|
}
|
|
|
|
@override
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'moodValue': _moodValue,
|
|
'comment': _comment,
|
|
'date': _date,
|
|
};
|
|
}
|
|
}
|