cpd_2022_zi/lib/models/mood.dart

24 lines
514 B
Dart
Raw Normal View History

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";
}
2023-02-22 01:28:01 +01:00
@override
Map<String, dynamic> toMap() {
return {
2023-02-25 15:30:04 +01:00
'value': _moodValue,
2023-02-22 01:28:01 +01:00
'comment': _comment,
2023-02-25 15:30:04 +01:00
'date': _date.toIso8601String(),
2023-02-22 01:28:01 +01:00
};
}
}