Span class

Class representing a range of integer values. The range includes all values in the interval [start, end]. Values may be negative, and the value of start may be less than, equal to, or greater than the value of end.

Constructors

Span(int start, int end)
const
Span.normalized(int start, int end)
Span.single(int start)
const

Properties

end int
final
hashCode int
The hash code for this object.
no setteroverride
isNormalized bool
Whether start is less than or equal to end.
no setter
length int
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start int
final

Methods

asIterable() Iterable<int>
Returns this span's range as an iterable collection of integers.
contains(Span span) bool
copyWith({int? start, int? end}) Span
intersect(Span span) Span?
intersects(Span span) bool
normalize() Span
Returns a span with the same range as this span but in which start is guaranteed to be less than or equal to end.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
union(Span span) Span

Operators

operator ==(Object other) bool
The equality operator.
override