genderLogic<T> method

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

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

Implementation

static T genderLogic<T>(String targetGender,
    {T female, T male, T other, String locale}) {
  if (other == null) {
    throw 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;
  }
}