summaryrefslogtreecommitdiff
path: root/lib/shift.dart
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2022-08-18 10:31:13 +0200
committerAldrik Ramaekers <aldrik@amftech.nl>2022-08-18 10:31:13 +0200
commitd7d1fccb42424c11e6a716558ac63fd633c9f3a4 (patch)
treecc5dd23b64f21901c2c8e25bd8f1e0b25036e3bb /lib/shift.dart
parentf136438a6c3df6403d5a935c730ea5a66d017ffe (diff)
responsive
Diffstat (limited to 'lib/shift.dart')
-rw-r--r--lib/shift.dart11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/shift.dart b/lib/shift.dart
index c444b38..a7c7719 100644
--- a/lib/shift.dart
+++ b/lib/shift.dart
@@ -20,15 +20,21 @@ class Shift {
DateTime start;
DateTime? end;
ShiftType type;
+ double payRate;
bool isActive = false;
- Shift({this.end = null, required this.start, required this.type});
+ Shift(
+ {this.end = null,
+ required this.start,
+ required this.type,
+ required this.payRate});
Shift.fromJson(Map<String, dynamic> json)
: start = DateTime.parse(json['start']),
end = json['end'] == null ? null : DateTime.tryParse(json['end']),
type = ShiftType.values.firstWhere((e) => e.toString() == json['type']),
- isActive = json['isActive'] == 'true';
+ isActive = json['isActive'] == 'true',
+ payRate = double.parse(json['payRate']);
Map<String, dynamic> toJson() {
return {
@@ -36,6 +42,7 @@ class Shift {
'end': end?.toIso8601String(),
'type': type.toString(),
'isActive': isActive.toString(),
+ 'payRate': payRate.toStringAsFixed(2),
};
}