ValhallaRequest constructor

ValhallaRequest({
  1. String? id,
  2. required List<LngLat> waypoints,
  3. List<LngLat>? excludeLocations,
  4. List? excludePolygones,
  5. ValhallaDirectionsType directionsType = ValhallaDirectionsType.instructions,
  6. BaseCostingOption? costingOption,
  7. Costing costing = Costing.auto,
  8. ValhallaUnit units = ValhallaUnit.km,
  9. Languages languages = Languages.en,
  10. DateTime? time,
  11. ValhallaFormat valhallaFormat = ValhallaFormat.json,
  12. Geometries? valhallaShapeFormat,
  13. bool? bannerInstructions,
  14. bool? voiceInstructions,
  15. int alternatives = 2,
})

Implementation

ValhallaRequest({
  this.id,
  required super.waypoints,
  this.excludeLocations,
  this.excludePolygones,
  this.directionsType = ValhallaDirectionsType.instructions,
  this.costingOption,
  this.costing = Costing.auto,
  this.units = ValhallaUnit.km,
  super.languages,
  this.time,
  this.valhallaFormat = ValhallaFormat.json,
  this.valhallaShapeFormat,
  this.bannerInstructions,
  this.voiceInstructions,
  super.alternatives,
})  : assert(
        waypoints.length == 2,
        "we dont support more that 2 points for routing service for now",
      ),
      assert(
        languages != Languages.ar,
        "arabic language not supported for now",
      ),
      assert(
        (valhallaFormat == ValhallaFormat.orsm &&
                Geometries.values.contains(valhallaShapeFormat)) ||
            valhallaFormat != ValhallaFormat.orsm,
      );