buildTextSpan method

  1. @protected
TextSpan buildTextSpan(
  1. BuildContext context,
  2. WidgetNodeSpec spec,
  3. Map state,
  4. Map? parentContext,
)

Implementation

@protected
TextSpan buildTextSpan(BuildContext context, WidgetNodeSpec spec, Map state,
    Map? parentContext) {
  TapGestureRecognizer? tapRecognizer;
  final onTap = events.getFunction(
      context, spec.actions["onTap"], state, parentContext);
  if (onTap != null) {
    tapRecognizer = TapGestureRecognizer()..onTap = onTap;
  }

  return TextSpan(
    text: Strings.get(spec.props["value"] ?? ""),
    style: spec.buildProp("style"),
    recognizer: tapRecognizer,
  );
}