stringToTravelMode function

TravelMode stringToTravelMode(
  1. String mode
)

Implementation

TravelMode stringToTravelMode(String mode) {
  if (mode.toLowerCase() == 'driving') return TravelMode.driving;
  if (mode.toLowerCase() == 'walking') return TravelMode.walking;
  if (mode.toLowerCase() == 'bicycling') return TravelMode.bicycling;
  if (mode.toLowerCase() == 'transit') return TravelMode.transit;
  return null;
}