buildTextSpans static method

List<TextSpan> buildTextSpans({
  1. TextStyle? style,
  2. required List<String> texts,
  3. required List<TextStyle?> styles,
  4. required List<GestureRecognizer?> recognizers,
  5. required List<String?> semanticsLabels,
  6. required List<MouseCursor?> mouseCursors,
  7. required List<PointerEnterEventListener?> onEnters,
  8. required List<PointerExitEventListener?> onExits,
  9. required List<Locale?> locales,
  10. required List<bool?> spellOuts,
})

Implementation

static List<TextSpan> buildTextSpans({
  TextStyle? style,
  required List<String> texts,
  required List<TextStyle?> styles,
  required List<GestureRecognizer?> recognizers,
  required List<String?> semanticsLabels,
  required List<MouseCursor?> mouseCursors,
  required List<PointerEnterEventListener?> onEnters,
  required List<PointerExitEventListener?> onExits,
  required List<Locale?> locales,
  required List<bool?> spellOuts,
}) =>
    texts.builderEntry((MapEntry<int, String> entry) => TextSpan(
        text: entry.value,
        semanticsLabel: semanticsLabels.isEmpty ||
                (semanticsLabels.length - 1) < entry.key
            ? null
            : semanticsLabels[entry.key],
        mouseCursor:
            mouseCursors.isEmpty || (mouseCursors.length - 1) < entry.key
                ? null
                : mouseCursors[entry.key],
        onEnter: onEnters.isEmpty || (onEnters.length - 1) < entry.key
            ? null
            : onEnters[entry.key],
        onExit: onExits.isEmpty || (onExits.length - 1) < entry.key
            ? null
            : onExits[entry.key],
        spellOut: spellOuts.isEmpty || (spellOuts.length - 1) < entry.key
            ? null
            : spellOuts[entry.key],
        locale: locales.isEmpty || (locales.length - 1) < entry.key
            ? null
            : locales[entry.key],
        recognizer:
            recognizers.isEmpty || (recognizers.length - 1) < entry.key
                ? null
                : recognizers[entry.key],
        style: styles.isEmpty || (styles.length - 1) < entry.key
            ? style
            : style == null
                ? styles[entry.key]
                : style.merge(styles[entry.key])));