calendarro 1.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 89

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:

Calendarro(
  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:

Calendarro(
  displayMode: DisplayMode.MONTHS,
  ...
  )

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

Calendarro(
  selectionMode: SelectionMode.MULTI,
  ...
  )

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

Calendarro(
  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:

Calendarro(
  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:

Calendarro(
  selectedDate: DateTime(2018, 8, 1)
  //or
  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:

  Calendarro(
    onTap: (date) {
        //your code
    }
    ...
    )

Advanced usage: #

For more advanced usage see: https://github.com/adamstyrc/parking-app

[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!

example/README.md

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:


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
88
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
81
Overall:
Weighted score of the above. [more]
89
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

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/calendarro.dart. (-1 points)

Analysis of lib/calendarro.dart reported 2 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 108 col 30: The operator x ~/ y is more efficient than (x / y).toInt().

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.date, 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.

Dependencies

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.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test