fromJson method

WeekType fromJson (dynamic json)

Converts JSON into a WeekType. Errors if given JSON representation is invalid.

Implementation

static WeekType fromJson(dynamic json) {
  switch (json) {
    case 0:
      return WeekType.A;
      break;

    case 1:
      return WeekType.B;
      break;

    default:
      throw 'Invalid JSON representation!';
  }
}