Range<T extends num> class
Null safety
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
Methods
-
contains(
num n) → bool -
Checks if the given value
n
is within this range. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent 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
tolast
inclusively, with common difference ofstep
which defaults to1
. [...] -
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 valuefrom
which defaults to0
, and a common difference ofstep
which defaults to1
. [...]