toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'type': type,
'object': object.toJson(),
if (name != null) 'name': name,
if (startLocation != null) 'startLocation': startLocation!.toJson(),
if (endLocation != null) 'endLocation': endLocation!.toJson(),
};
}