stringToTrafficModel function

TrafficModel stringToTrafficModel(
  1. String type
)

Implementation

TrafficModel stringToTrafficModel(String type) {
  if (type.toLowerCase() == 'best_guess') return TrafficModel.bestGuess;
  if (type.toLowerCase() == 'pessimistic') return TrafficModel.pessimistic;
  if (type.toLowerCase() == 'optimistic') return TrafficModel.optimistic;
  return null;
}