range2 0.1.1
range2: ^0.1.1

Dart native js
Flutter Android iOS web

Dart2 compatible python-like range() function implemented using sync*.

Usage #

A simple usage example:

import 'package:range2/range2.dart';

main() {
  print('${range(1, 5)}');             // (1, 2, 3, 4) 
  print('${range(1, 10,  3)}');        // (1, 4, 7)
  print('${range(-5, 0)}');            // (-5, -4, -3, -2, -1)
  print('${range(-5, -10, -1)}');      // (-5, -6, -7, -8, -9)

  for (var n in range(1, 10, 2)) {
    print(n);
  }
  // 1
  // 3
  // 5
  // 7
  // 9
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
110
pub points
0%
popularity

Dart2 compatible python-like range() function implemented using sync*.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

xty50337@gmail.com

License

MIT (LICENSE)

More

Packages that depend on range2