asString method

String asString({
  1. required Position start,
  2. required Position end,
  3. bool isInclusive = false,
})

Returns the text between two positions as a string. start ist the position to start. end is the the end of the wanted text. if isInclusive is true end is part of the returned text.

Implementation

String asString(
    {required Position start,
    required Position end,
    bool isInclusive = false}) {
  final list = asList(start: start, end: end, isInclusive: isInclusive);
  return list.join('\n');
}