genderLogic method

dynamic genderLogic (
  1. String targetGender,
  2. {dynamic female,
  3. dynamic male,
  4. dynamic other,
  5. String locale}
)

Internal: Implements the logic for gender selection - use gender for normal messages.

Implementation

static genderLogic(String targetGender,
    {female, male, other, String locale}) {
  if (other == null) {
    throw new ArgumentError("The 'other' named argument must be specified");
  }
  switch (targetGender) {
    case "female":
      return female == null ? other : female;
    case "male":
      return male == null ? other : male;
    default:
      return other;
  }
}