applyChild method

RichTextBuilder applyChild(
  1. String text, {
  2. TextStyle? baseStyle,
})

Implementation

RichTextBuilder applyChild(
  String text, {
  TextStyle? baseStyle,
}) {
  if (!text.isNullOrBlank) {
    GestureRecognizer? recognizer;
    if (_gesture != null && !_preserveGestures) {
      final tapCallback = _gesture;
      recognizer = TapGestureRecognizer()
        ..onTap = () {
          tapCallback!(context);
        };
      _gesture = null;
    }
    children.add(TextSpan(
      style: baseStyle.mergeOrDefault(_temp),
      text: text,
      recognizer: recognizer,
      semanticsLabel: "Tap to open record",
    ));
  }
  if (_preserveStyles != true) _temp = null;

  return this;
}