buildRichText method

  1. @protected
Widget buildRichText(
  1. BuildParameters params
)

Implementation

@protected
Widget buildRichText(BuildParameters params) {
  final spanParts = <TextSpan>[];
  final evaluatorContext = Lowder.properties
      .getEvaluatorContext(null, params.state, params.parentContext);
  for (var child in params.widgets["children"]) {
    properties.evaluateMap(child, evaluatorContext);
    spanParts.add(buildTextSpan(params.context, WidgetNodeSpec.fromMap(child),
        params.state, params.parentContext));
  }

  return RichText(
    key: properties.getKey(params.id),
    text: TextSpan(children: spanParts),
    overflow: params.buildProp("overflow") ?? TextOverflow.clip,
    softWrap: parseBool(params.props["softWrap"], defaultValue: true),
    textAlign: params.buildProp("textAlign"),
    maxLines: tryParseInt(params.props["maxLines"]),
  );
}