For complex expressions like plurals and genders, you can use Intl.plural and Intl.gender. These can be nested.
Using Intl.plural:
You can wrap the plural logic inside an Intl.message call, or if the plural is the top-level requirement of the function, you can call Intl.plural directly and provide the name, args, desc, and examples to it.
Using Intl.gender:
Use Intl.gender to provide different message variations based on a gender string (e.g., 'male', 'female', 'other').
// Plural example
remainingEmailsMessage(int howMany, String userName) =>
Intl.plural(
howMany,
zero: 'There are no emails left for $userName.',
one: 'There is $howMany email left for $userName.',
other: 'There are $howMany emails left for $userName.',
name: 'remainingEmailsMessage',
args: [howMany, userName],
desc: 'How many emails remain after archiving.',
examples: const {'howMany': 42, 'userName': 'Fred'});
// Gender example
notOnlineMessage(String userName, String userGender) =>
Intl.gender(
userGender,
male: '$userName is unavailable because he is not online.',
female: '$userName is unavailable because she is not online.',
other: '$userName is unavailable because they are not online',
name: 'notOnlineMessage',
args: [userName, userGender],
desc: 'The user is not available to hangout.',
examples: const {'userGender': 'male', 'userName': 'Fred'});