fromCode static method

MaritalStatus? fromCode(
  1. String code
)

Returns the marital status based on the string code, and returns null if no match is found

Implementation

static MaritalStatus? fromCode(String code) => switch (code) {
      ('NM') => MaritalStatus.neverMarried,
      ('W') => MaritalStatus.widowed,
      ('D') => MaritalStatus.divorced,
      ('S') => MaritalStatus.separated,
      ('I') => MaritalStatus.interlocutory,
      ('L') => MaritalStatus.legallyMarried,
      ('P') => MaritalStatus.polygamous,
      ('T') => MaritalStatus.domesticPartner,
      ('U') => MaritalStatus.unmarried,
      ('UNK') => MaritalStatus.unknown,
      (_) => null,
    };