Range<T extends num> class

Represents a range of numbers.

Please note that it's not a strict counterpart of the range in mathematics. In fact, to keep things simple, it's just a pair of numbers, marks the beginning and end of the range, respectively. So that it can represent a reverse range easily, e.g., 3.0..1.0.

Implementers

Properties

from → T
The beginning value in the range.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
to → T
The end value in the range.
final

Methods

contains(num n) bool
Checks if the given value n is within this range.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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

Static Methods

progression(int first, int last, {int step = 1}) IntRange
Create an arithmetic progression from first to last inclusively, with common difference of step which defaults to 1.
range(double from, double to) Range<double>
Factory method to create a closed floating-point range of type double: [from, to].
upTo(int to, {int from = 0, int step = 1}) IntRange
Factory method to create a progression in which the maximum value is to, with an optional minimum value from which defaults to 0, and a common difference of step which defaults to 1.