stringToTransitMode function

TransitMode stringToTransitMode(
  1. String type
)

Implementation

TransitMode stringToTransitMode(String type) {
  if (type.toLowerCase() == 'bus') return TransitMode.bus;
  if (type.toLowerCase() == 'subway') return TransitMode.subway;
  if (type.toLowerCase() == 'train') return TransitMode.train;
  if (type.toLowerCase() == 'tram') return TransitMode.tram;
  if (type.toLowerCase() == 'rail') return TransitMode.rail;
  return null;
}