fromString static method

TrainStatus fromString(
  1. String value
)

Get a TrainStatus from a given string value.

Implementation

static TrainStatus fromString(String value) {
  return values.firstWhere(
    (unitType) => unitType.value == value,
    orElse: () => unknown,
  );
}