textSpans property

List<TextSpan> get textSpans

Returns a list of TextSpan from the children provided.

Implementation

List<TextSpan> get textSpans {
  List<TextSpan> textSpans = [];
  for (Text child in children) {
    textSpans.add(TextSpan(
      text: child.data,
      style: child.style ?? style,
      spellOut: spellOut,
      onEnter: (event) {
        if (onEnter == null) return;
        onEnter!(child, event);
      },
      onExit: (event) {
        if (onExit == null) return;
        onExit!(child, event);
      },
    ));
  }
  return textSpans;
}