calendarro 1.1.2

Calendarro #

Calendar widget library for Flutter apps. Offers multiple ways to customize the widget.

Getting Started #

Installation #

Add dependency to your pubspec.yaml:

calendarro: ^1.1.2

Basic use #

First, add an import to your code:

import 'package:calendarro/calendarro.dart';

Add a widget to your code:

  startDate: DateUtils.getFirstDayOfCurrentMonth(),
  endDate: DateUtils.getLastDayOfCurrentMonth()

alt tag

Customization #

alt tag

1. Display Mode - If you prefer to operate on multiple rows to see whole month, use:

  displayMode: DisplayMode.MONTHS,

2. Selection Mode - If you want to select multiple dates, use:

  selectionMode: SelectionMode.MULTI,

3. Weekday Labels - If you want to provide your own row widget for displaying weekday names, use:

  weekdayLabelsRow: CustomWeekdayLabelsRow()

you can create your CustomWeekdayLabelsRow by looking at default CalendarroWeekdayLabelsView.

4. Day Tile Builder - If you want to build day tiles your own way, you can use:

  dayTileBuilder: CustomDayTileBuilder()

you can create your CustomDayTileBuilder looking upon DefaultDayTileBuilder.

5. Initial selected dates - When you want some dates to be selected from the scratch, use selectedDate (SelectionMode.SINGLE) or selectedDates (SelectionMode.MULTI) arguments:

  selectedDate: DateTime(2018, 8, 1)
  selectedDates: [DateTime(2018, 8, 1), DateTime(2018, 8, 8)]

you can create your CustomDayTileBuilder looking upon DefaultDayTileBuilder.

Selecting date callback #

If you want to get a callback when a date tile is clicked, there is onTap param:

    onTap: (date) {
        //your code

Advanced usage: #

For more advanced usage see:

[1.1.2] 9 October 2019

  • Fix DateUtils.calculateMonthsDifference() method.

[1.1.1] 3 October 2019

  • Fix calculating pages count when years change.

[1.1.0] 23 September 2019

  • Fix multiple dates selection.
  • Add CurrentPageCallback for getting selected page start and end dates.

[1.0.1] 3 September 2019

  • Fix DateUtils.getLastDayOfMonth() method.

[1.0.0] 14 August 2019

  • Calculate height of Calendarro in dependency of max weeks number (MONTHLY mode).
  • Fix minor bugs with paging.

[0.0.5] 17 November 2018

  • Fix counting pages for DisplayMode.WEEKS due to bug for February.

[0.0.4] 17 November 2018

  • Change Calendarro height in month mode

[0.0.3] 17 November 2018

  • Add onTap callback for Calendarro

[0.0.2] 3 September 2018

  • Fix

[0.0.1] - 6 August 2018

  • Introduce Calendarro!


sample #

sample app

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

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

  calendarro: ^1.1.2

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:calendarro/calendarro.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 Feb 18, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Health suggestions

Fix lib/calendarro.dart. (-1.99 points)

Analysis of lib/calendarro.dart reported 4 hints:

line 20 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: Calendarro.startDate, Calendarro.endDate, Calendarro.displayMode, Calendarro.selectionMode, Calendarro.dayTileBuilder, Calendarro.weekdayLabelsRow, Calendarro.onTap, Calendarro.onPageSelected, Calendarro.selectedDate, Calendarro.selectedDates, Calendarro.startDayOffset, Calendarro.state, Calendarro.dayTileHeight, Calendarro.dayLabelHeight

line 81 col 15: 'ancestorStateOfType' is deprecated and shouldn't be used. Use findAncestorStateOfType instead. This feature was deprecated after v1.12.1..

line 81 col 41: 'TypeMatcher' is deprecated and shouldn't be used. TypeMatcher has been deprecated because it is no longer used in framework(only in deprecated methods). This feature was deprecated after v1.12.1..

line 108 col 30: The operator x ~/ y is more efficient than (x / y).toInt().

Fix lib/calendarro_page.dart. (-1.49 points)

Analysis of lib/calendarro_page.dart reported 3 hints:

line 3 col 8: Unused import: 'package:calendarro/default_weekday_labels_row.dart'.

line 6 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: CalendarroPage.pageStartDate, CalendarroPage.pageEndDate, CalendarroPage.weekdayLabelsRow, CalendarroPage.startDayOffset

line 8 col 16: Name non-constant identifiers using lowerCamelCase.

Fix lib/default_day_tile.dart. (-0.50 points)

Analysis of lib/default_day_tile.dart reported 1 hint:

line 5 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final:, CalendarroDayItem.calendarroState, CalendarroDayItem.onTap

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/date_range.dart (Run flutter format to format lib/date_range.dart.)
  • lib/date_utils.dart (Run flutter format to format lib/date_utils.dart.)
  • lib/default_day_tile_builder.dart (Run flutter format to format lib/default_day_tile_builder.dart.)
  • lib/default_weekday_labels_row.dart (Run flutter format to format lib/default_weekday_labels_row.dart.)

Maintenance suggestions

The package description is too short. (-19 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >1.19.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies