heatmap_calendar_shamsi 1.0.12+3

  • Readme
  • Changelog
  • Example
  • Installing
  • new64

Build Status

Flutter Heat Map Calendar #

A Heat Map Calendar based on heatmap_calendar but it also uses shamsi calender instead with some extra options like its bidirectional not just from past to today and also months are localized.

HeatMap Calendar in action

Installing #

1. Depend on it #

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

Also shamsi_date package is required

dependencies:
  heatmap_calendar_shamsi: ^1.0.12+2
  shamsi_date: ^0.8.1

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_shamsi/heatmap_calendar_shamsi.dart';
import 'package:heatmap_calendar_shamsi/time_utils.dart';
...

HeatMapCalendar(
  // use Jalali.fromDateTime if using usual gregorian calender
  input: {
    TimeUtils.removeTime(Jalali.now().addDays(-3)): 5,
    TimeUtils.removeTime(Jalali.now().addDays(-2)): 35,
    TimeUtils.removeTime(Jalali.now().addDays(-1)): 14,
    TimeUtils.removeTime(Jalali.now()): 5,
  },
  colorThresholds: {
    1: Colors.green[100],
    10: Colors.green[300],
    30: Colors.green[500]
  },
  squareSize: 20.0,
    textOpacity: 0.3,
    labelTextColor: Colors.blueGrey,
    dayTextColor: Colors.blue[500],
    direction: HeatMapCalenderDirection.NOW_TO_TOMORROW,
    calenderType: HeatMapCalenderType.GREGORIAN,
    context: context,
  )

[1.0.12+3] - 2020-07-01 #

  • update readme

[1.0.12+2] - 2020-06-30 #

  • update readme

[1.0.12+1] - 2020-06-30 #

  • show day lables by default

[1.0.12] - 2020-06-30 #

  • show day lables by default

[1.0.11] - 2020-06-29 #

  • fix bug where valued squares were all gray

[1.0.10+3] - 2020-06-29 #

  • better documents

[1.0.10+2] - 2020-06-29 #

  • localizations of month lables

[1.0.10+1] - 2020-06-29 #

  • minor bug fix

[1.0.10] - 2020-06-29 #

  • translate weekdays to english

[1.0.9] - 2020-06-28 #

  • add gregorian options for day numbers

[1.0.8] - 2020-06-28 #

  • fix week lables in bidrections

[1.0.7+2] - 2020-06-28 #

  • minor change

[1.0.7+1] - 2020-06-28 #

  • minor change

[1.0.7] - 2020-06-28 #

  • tweak directions

[1.0.6] - 2020-06-28 #

  • tweak week lables

[1.0.5] - 2020-06-28 #

  • add bidirectional option to calender

[1.0.4] - 2020-06-28 #

  • change direction of calender from now to next days

[1.0.3] - 2020-06-28 #

  • change default month and week lables to jalali

[1.0.2] - 2020-06-28 #

  • fix datesBetween function loop bug

[1.0.1] - 2020-06-27 #

  • Change all DateTimes to Jalali

[1.0.0] - 2020-06-27 #

  • initial

example/main.dart

import 'package:flutter/material.dart';
import 'package:heatmap_calendar_shamsi/heatmap_calendar_shamsi.dart';
import 'package:heatmap_calendar_shamsi/time_utils.dart';
import 'package:shamsi_date/shamsi_date.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(Jalali.now().addDays(-3)): 5,
          TimeUtils.removeTime(Jalali.now().addDays(-2)): 35,
          TimeUtils.removeTime(Jalali.now().addDays(-1)): 14,
          TimeUtils.removeTime(Jalali.now()): 5,
            },
            colorThresholds: {
              1: Colors.green[100],
              10: Colors.green[300],
              30: Colors.green[500]
            },
            squareSize: 20.0,
            textOpacity: 0.3,
            labelTextColor: Colors.blueGrey,
            dayTextColor: Colors.blue[500],
            direction: HeatMapCalenderDirection.NOW_TO_TOMORROW,
            calenderType: HeatMapCalenderType.SHAMSI,
            context: context,
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  heatmap_calendar_shamsi: ^1.0.12+3

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_shamsi/heatmap_calendar_shamsi.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
28
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]
64
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • heatmap_calendar_shamsi that is a package requiring null.

Health suggestions

Format lib/week_columns.dart.

Run flutter format to format lib/week_columns.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
shamsi_date ^0.8.1 0.8.1
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test
mockito ^4.0.0