2023-02-16 01:59:15 +01:00
|
|
|
import 'package:smoke_cess_app/interface/db_record.dart';
|
|
|
|
|
|
|
|
class HIITWorkout implements DatabaseRecord {
|
2023-02-22 01:28:01 +01:00
|
|
|
Duration _workoutDuration;
|
|
|
|
String _commentBefore;
|
|
|
|
String _commentAfter;
|
|
|
|
DateTime _workoutDate;
|
2023-02-16 01:59:15 +01:00
|
|
|
|
|
|
|
HIITWorkout(this._workoutDuration, this._commentBefore, this._commentAfter,
|
|
|
|
this._workoutDate);
|
|
|
|
|
2023-02-25 18:54:23 +01:00
|
|
|
//TODO Felder anpassen
|
|
|
|
@override
|
|
|
|
factory HIITWorkout.fromMap(Map<String, dynamic> map) {
|
|
|
|
return HIITWorkout(map['_workoutDuration'], map['_commentBefore'],
|
|
|
|
map['_commentAfter'], map['_workoutDate']);
|
|
|
|
}
|
2023-02-22 01:28:01 +01:00
|
|
|
|
2023-02-16 01:59:15 +01:00
|
|
|
@override
|
|
|
|
String toCSV() =>
|
|
|
|
"${_workoutDate.toIso8601String()}, $_workoutDuration, $_commentBefore, $_commentAfter";
|
2023-02-22 01:28:01 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Map<String, dynamic> toMap() {
|
|
|
|
return {
|
|
|
|
'workoutDuration': _workoutDuration,
|
|
|
|
'commentBefore': _commentBefore,
|
|
|
|
'commentAfter': _commentAfter,
|
|
|
|
'workoutDate': _workoutDate,
|
|
|
|
};
|
|
|
|
}
|
2023-02-16 01:59:15 +01:00
|
|
|
}
|