textFor method

String textFor(
  1. int start,
  2. int end
)

Implementation

String textFor(int start, int end) {
  final int from = start.clamp(0, text.length);
  final int to = end.clamp(0, text.length);
  return to <= from ? "" : text.substring(from, to);
}