Skip to content

Commit c75dd9f

Browse files
committed
Adding endIndex getter to SpanRange
1 parent 8255cbe commit c75dd9f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

attributed_text/lib/src/span_range.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class SpanRange {
4040
/// If [start] and [end] are both -1, the text range is empty.
4141
final int end;
4242

43+
/// The index of the last character in the range.
44+
int get endIndex => end - 1;
45+
4346
/// Whether this range represents a valid position in the text.
4447
bool get isValid => start >= 0 && end >= 0;
4548

0 commit comments

Comments
 (0)