Skip to content

Commit

Permalink
Adding endIndex getter to SpanRange
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatth committed Aug 1, 2022
1 parent d1e80d9 commit 69b50a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions attributed_text/lib/src/span_range.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class SpanRange {
/// If [start] and [end] are both -1, the text range is empty.
final int end;

/// The index of the last character in the range.
int get endIndex => end - 1;

/// Whether this range represents a valid position in the text.
bool get isValid => start >= 0 && end >= 0;

Expand Down

0 comments on commit 69b50a1

Please sign in to comment.