fromName static method

ORSProfile fromName(
  1. String profileName
)

Returns the ORSProfile represented by the String profileName.

The String is case-sensitive and has to be one of: "driving-car", "driving-hgv", "cycling-road", "cycling-mountain", "cycling-electric", "foot-walking", "foot-hiking", "wheelchair".

If the String is not one of the above, an ArgumentError is thrown.

Implementation

static ORSProfile fromName(final String profileName) {
  if (_nameToProfileMap.containsKey(profileName)) {
    return _nameToProfileMap[profileName]!;
  }
  throw ArgumentError('Unknown ORSProfile: $profileName');
}