build method

  1. @override
String? build(
  1. Object? context, {
  2. bool asElement = true,
  3. bool resolveDSX = true,
  4. QueryElementProvider? elementProvider,
  5. IntlMessageResolver? intlMessageResolver,
})
override

Implementation

@override
String? build(Object? context,
    {bool asElement = true,
    bool resolveDSX = true,
    QueryElementProvider? elementProvider,
    IntlMessageResolver? intlMessageResolver}) {
  if (intlMessageResolver == null) return '';

  Map<String, dynamic>? parameters;

  if (context is Map<String, dynamic>) {
    parameters = context;
  } else if (context is Map) {
    parameters =
        context.map((key, value) => MapEntry('$key', value as dynamic));
  } else if (context is DOMContext) {
    parameters = context.variables;
  }

  var s = intlMessageResolver(key, parameters);
  return s;
}