diff --git a/attributed_text/lib/src/attributed_spans.dart b/attributed_text/lib/src/attributed_spans.dart index 5f714d779..3333f24ce 100644 --- a/attributed_text/lib/src/attributed_spans.dart +++ b/attributed_text/lib/src/attributed_spans.dart @@ -1038,9 +1038,22 @@ class AttributionSpan { }); final Attribution attribution; + + /// The start of the span, inclusive. + /// + /// Content at this index will have [attribution] applied. final int start; + + /// The end of the span, exclusive. + /// + /// Content at this index will _not_ have [attribution] applied. final int end; + /// The end of the span, inclusive. + /// + /// Content at this index will have [attribution] applied. + int get endIndex => end - 1; + AttributionSpan constrain({ required int start, required int end, @@ -1093,9 +1106,22 @@ class MultiAttributionSpan { }); final Set attributions; + + /// The start of the span, inclusive. + /// + /// Content at this index will have [attributions] applied. final int start; + + /// The end of the span, exclusive. + /// + /// Content at this index will _not_ have [attributions] applied. final int end; + /// The end of the span, inclusive. + /// + /// Content at this index will have [attributions] applied. + int get endIndex => end - 1; + MultiAttributionSpan copyWith({ Set? attributions, int? start,