heatmap_calendar 1.2.5

Build Status

Flutter Heat Map Calendar #

A Heat Map Calendar based on Github's contributions chart which can be used to visualize values over time

HeatMap Calendar in action

Installing #

1. Depend on it #

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

dependencies:
  heatmap_calendar: ^1.2.5

2. Install it #

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Example #

import 'package:heatmap_calendar/heatmap_calendar.dart';
import 'package:heatmap_calendar/time_utils.dart';
...

HeatMapCalendar(
  input: {
    TimeUtils.removeTime(DateTime.now().subtract(Duration(days: 3))): 5,
    TimeUtils.removeTime(DateTime.now().subtract(Duration(days: 2))): 35,
    TimeUtils.removeTime(DateTime.now().subtract(Duration(days: 1))): 14,
    TimeUtils.removeTime(DateTime.now()): 5,
  },
  colorThresholds: {
    1: Colors.green[100],
    10: Colors.green[300],
    30: Colors.green[500]
  },
  weekDaysLabels: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
  monthsLabels: [
    "",
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun",
    "Jul",
    "Aug",
    "Sep",
    "Oct",
    "Nov",
    "Dec",
  ],
  squareSize: 16.0,
  textOpacity: 0.3,
  labelTextColor: Colors.blueGrey,
  dayTextColor: Colors.blue[500],
)

[1.2.5] - 2019-07-06

  • Fixing issues when creating the calendar columns (validating if datesList is not empty)

[1.2.4] - 2019-05-31

  • Fixing issues

[1.2.3] - 2019-05-31

  • Fixing tests

[1.2.2] - 2019-05-31

  • Fixing width problems

[1.2.1] - 2019-05-31

  • Fixing unused import

[1.2.0] - 2019-05-31

  • Creating tests for all classes
  • Separated WeekColumns logic to a new Widget

[1.1.2] - 2019-05-27

  • Fixing margin on week labels

[1.1.1] - 2019-05-27

  • Fixing the amount of columns that are being created

[1.1.0] - 2019-05-26

  • Building columns based on the layout available widget

[1.0.2] - 2019-05-25

  • Adding Travis CI integration

[1.0.1] - 2019-05-25

  • Formatting code and fixing pub requirements

[1.0.0] - 2019-05-25

  • Release of the package

example/main.dart

import 'package:flutter/material.dart';
import 'package:heatmap_calendar/heatmap_calendar.dart';
import 'package:heatmap_calendar/time_utils.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: SafeArea(
          child: HeatMapCalendar(
            input: {
              TimeUtils.removeTime(DateTime.now().subtract(Duration(days: 3))): 5,
              TimeUtils.removeTime(DateTime.now().subtract(Duration(days: 2))): 35,
              TimeUtils.removeTime(DateTime.now().subtract(Duration(days: 1))): 14,
              TimeUtils.removeTime(DateTime.now()): 5,
            },
            colorThresholds: {
              1: Colors.green[100],
              10: Colors.green[300],
              30: Colors.green[500]
            },
            weekDaysLabels: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
            monthsLabels: [
              "",
              "Jan",
              "Feb",
              "Mar",
              "Apr",
              "May",
              "Jun",
              "Jul",
              "Aug",
              "Sep",
              "Oct",
              "Nov",
              "Dec",
            ],
            squareSize: 20.0,
            textOpacity: 0.3,
            labelTextColor: Colors.blueGrey,
            dayTextColor: Colors.blue[500],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  heatmap_calendar: ^1.2.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:heatmap_calendar/heatmap_calendar.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
38
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
mockito ^4.0.0

Admin