styleAt method

TextStyle styleAt(
  1. int i,
  2. TextStyle base,
  3. ColorScheme cs
)

The resolved TextStyle for the character at index i.

Implementation

TextStyle styleAt(int i, TextStyle base, ColorScheme cs) {
  final Map<UInlineAttr, Object?> active = <UInlineAttr, Object?>{};
  for (final UStyleSpan sp in spans) {
    if (i >= sp.start && i < sp.end) active[sp.attr] = sp.value;
  }
  return resolveStyle(active, base, cs);
}