TextInfo constructor

const TextInfo({
  1. required int start,
  2. required int end,
  3. required String text,
})

Describes an immutable span of text with start and end offsets and the associated substring.

The start offset is inclusive and the end offset is exclusive. The instance stores the slice of text for that range in text. Offsets should satisfy 0 <= start <= end.

Constructor:

  • TextInfo({required int start, required int end, required String text}) Creates a text span with the given offsets and content.

Fields:

  • start: Inclusive start offset of the span.
  • end: Exclusive end offset of the span.
  • text: The substring corresponding to the span.

Methods:

  • contains(int offset) -> bool Returns true if offset lies within the span (start <= offset < end).

Implementation

const TextInfo({required this.start, required this.end, required this.text});