From d7d1fccb42424c11e6a716558ac63fd633c9f3a4 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Thu, 18 Aug 2022 10:31:13 +0200 Subject: responsive --- lib/shift.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/shift.dart') 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 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 toJson() { return { @@ -36,6 +42,7 @@ class Shift { 'end': end?.toIso8601String(), 'type': type.toString(), 'isActive': isActive.toString(), + 'payRate': payRate.toStringAsFixed(2), }; } -- cgit v1.2.3-70-g09d2