Skip to content
No description, website, or topics provided.
Dart
Branch: master
Clone or download
Pull request Compare This branch is 5 commits ahead of seaneagan:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.gitignore
LICENSE
README.md
pubspec.yaml

README.md

interval pub package Build Status

Provides the Interval class, a contiguous set of values.

If an Interval contains two values, it also contains all values between them. It may have an upper and lower bound, and those bounds may be open or closed.

##Install

pub global activate den # If you haven't already
den install interval

##Usage

import 'package:interval/interval.dart';

// Date intervals
var activeDates = new Interval<DateTime>.closed(date1, date2);
if(activeDates.contains(new DateTime.now()) {
  print('Item is active!');
}

// View selection model
var slider = new Slider(interval: new Interval.closed(0, 100));

// Validation
class Rating {
  final int value;

  Rating(this.value) {
    if(!new Interval.closed(1, 5).contains(value)) {
      throw new ArgumentError('ratings must be between 1 and 5');
    }
  }
}
You can’t perform that action at this time.