decodeEvents static method
Implementation
static Events? decodeEvents(Object? mapInput) {
if (mapInput == null || !(mapInput is Map?)) {
return null;
}
try {
Map map = mapInput as Map;
String? id = map['id'];
String? tripId = map['trip_id'];
String? userId = map['user_id'];
String? eventType = map['event_type'];
String? createdAt = map['created_at'];
String? eventSource = map['event_source'];
String? eventVersion = map['event_version'];
String? locationId = map['location_id'];
Events events =
Events(id: id, tripId: tripId, userId: userId, eventType: eventType, createdAt: createdAt, eventSource: eventSource, eventVersion: eventVersion, locationId: locationId);
return events;
} catch (error) {
print('Decode event ' + error.toString());
return null;
}
}