get method

String? get(
  1. String messageId, {
  2. Map<String, Object>? args,
})

Looks up and evaluates an ICU MessageFormat template by messageId.

Substitutes args into the message pattern according to ICU rules (plurals, select, numbers, dates). Returns null if messageId is not found in this catalog.

final msg = catalog.get('unread_messages', args: {'count': 4});

See also:

Implementation

String? get(String messageId, {Map<String, Object>? args}) {
  final template = _messages[messageId];
  if (template == null) return null;
  return formatMessage(template, args: args, locale: locale);
}