rich static method

Handler for overridden rich text. Returns a TextSpan if the path was successfully overridden. Returns null otherwise.

Implementation

static TextSpan? rich(
    TranslationMetadata meta, String path, Map<String, Object> param) {
  final node = meta.overrides[path];
  if (node == null) {
    return null;
  }
  if (node is! RichTextNode) {
    print(
        'Overridden $path is not a RichTextNode but a ${node.runtimeType}.');
    return null;
  }

  return node._buildTextSpan(meta, param);
}