class Colonia { const Colonia({ required this.id, required this.nombre, this.routeId, this.horarioEstimado, this.turno, }); final String id; final String nombre; final String? routeId; final String? horarioEstimado; final String? turno; factory Colonia.fromJson(Map json) { final rawId = json['id'] ?? json['routeId'] ?? json['route_id'] ?? json['nombre'] ?? json['name']; final rawNombre = json['nombre'] ?? json['name'] ?? rawId; return Colonia( id: rawId?.toString() ?? rawNombre?.toString() ?? '', nombre: rawNombre?.toString() ?? '', routeId: (json['routeId'] ?? json['route_id'])?.toString(), horarioEstimado: (json['horario_estimado'] ?? json['horarioEstimado'] ?? json['schedule']) ?.toString(), turno: (json['turno'] ?? json['shift'])?.toString(), ); } }