33 lines
757 B
Dart
33 lines
757 B
Dart
import 'WeekArrayData.dart';
|
|
|
|
class ShiftLocation {
|
|
ShiftLocation({
|
|
this.locationId,
|
|
this.weekArray,
|
|
this.id,});
|
|
|
|
ShiftLocation.fromJson(dynamic json) {
|
|
locationId = json['locationId'];
|
|
if (json['weekArray'] != null && json['weekArray'] is List) {
|
|
weekArray = [];
|
|
json['weekArray'].forEach((v) {
|
|
weekArray?.add(WeekArrayData.fromJson(v));
|
|
});
|
|
}
|
|
id = json['_id'];
|
|
}
|
|
String? locationId;
|
|
List<WeekArrayData>? weekArray;
|
|
String? id;
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final map = <String, dynamic>{};
|
|
map['locationId'] = locationId;
|
|
if (weekArray != null) {
|
|
map['weekArray'] = weekArray?.map((v) => v.toJson()).toList();
|
|
}
|
|
map['_id'] = id;
|
|
return map;
|
|
}
|
|
|
|
} |