fromCode static method

AdministrativeGender fromCode(
  1. String code
)

Returns the gender based on the string code, and returns unknown if no match is found

Implementation

static AdministrativeGender fromCode(String code) => switch (code) {
      ('male') => AdministrativeGender.male,
      ('female') => AdministrativeGender.female,
      ('other') => AdministrativeGender.other,
      (_) => AdministrativeGender.unknown,
    };