diff --git a/attributed_text/lib/src/span_range.dart b/attributed_text/lib/src/span_range.dart index 57e526588..2c12a86f3 100644 --- a/attributed_text/lib/src/span_range.dart +++ b/attributed_text/lib/src/span_range.dart @@ -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;