fromString method Null safety

DriverTestMessage fromString(
  1. String status
)

Return a DriverTestMessage depending on status.

Implementation

static DriverTestMessage fromString(String status) {
  switch (status) {
    case 'error':
      return DriverTestMessage.error();
    case 'pending':
      return DriverTestMessage.pending();
    case 'complete':
      return DriverTestMessage.complete();
    default:
      throw StateError('This type of status does not exist: $status');
  }
}