dart_range 0.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • --

dart_range

A library which provide ways of generating a sequence of numbers.

Basic Usage

range() method creates a Range object as follows:

range(1, 5);    // [1, 2, 3, 4]
range(1, 8, 2); // [1, 3, 5, 7]

Range class implements Iterable, so you can easily iterate over it:

range(0, 3).forEach((e) => print(e)); // 0, 1, 2

For creating detailed ranges, you have:

inclusiveRange(begin, end, [step]);  // [begin, end]
exclusiveRange(begin, end, [step]);  // (begin, end)
openClosedRange(begin, end, [step]); // (begin, end]
closedOpenRange(begin, end, [step]); // [begin, end)

You can also create a infinite range:

openInfiniteRange(begin, [step]);   // (begin, infinity)
closedInfiniteRange(begin, [step]); // [begin, infinity)

If you need a type-specific range, please use:

intRange(begin, end);
inclusiveIntRange(begin, end);
doubleRange(begin, end);
inclusiveDoubleRange(begin, end);
// and so on

Changelog

0.0.1

  • Initial version.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_range: "^0.0.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:dart_range/dart_range.dart';
  
Version Uploaded Documentation Archive
1.0.1 Nov 10, 2017 Go to the documentation of dart_range 1.0.1 Download dart_range 1.0.1 archive
1.0.0 Nov 10, 2017 Go to the documentation of dart_range 1.0.0 Download dart_range 1.0.0 archive
0.0.1 Feb 4, 2015 Go to the documentation of dart_range 0.0.1 Download dart_range 0.0.1 archive

Analysis

This package version is not analyzed, because it is more than two years old. Check the latest stable version for its analysis.