date_range 1.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 63

date_range #

A simple way to find a daterange in which a datetime is. Used for db queries.

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

[1.0.3] - Notation changed to match Dart guidelines. #

DateRange's lastDateTime now represents the final microsecond of the date range instead of the first instance of the next date range. Please use DateRange.month(final DateTime inner) constructor.

[1.0.2] - Added translation to text #

[1.0.1] - Now using Dart DateTime's const #

[1.0.0] - Initial release #


import 'package:date_range/date_range.dart';

void main(){
  final DateTime dateTime =;
  final DateRange dateRange = DateRange.month(dateTime);
  final List<data> data = db.query(lt: dateRange.lastDateTime, gt: dateRange.firstDateTime)

Use this package as a library

1. Depend on it

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

  date_range: ^1.0.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:date_range/date_range.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 30, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-1 points)

12 out of 12 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/date_range.dart.

Run dartfmt to format lib/date_range.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
Dev dependencies
test ^1.9.3