from static method

dynamic from(
  1. String value
)

Make license plate from string

Implementation

static from(String value) {
  if (value.length <= 5) return null;

  try {
    return PoliceLicensePlate(
      series: value[0],
      number: int.parse(value.substring(1, 5).toString()),
      region: int.parse(value.substring(5)),
    );
  } catch (e) {
    return null;
  }
}