This package allows the creation of event-based project calendars.

Installing:

In your pubspec.yaml

dependencies:
  bar_calendar: ^0.0.9
import 'package:bar_calendar/bar_calendar.dart';

Basic Usage:

    BarCalendar(
        backgroundColor: Colors.grey.withOpacity(.4),
        events: [
          CalendarEvent(
              title: 'First Event',
              start: DateTime.now(),
              end: DateTime.now().add(const Duration(days: 8))),
          CalendarEvent(
              title: 'Second Event',
              start: DateTime.now(),
              end: DateTime.now().add(const Duration(days: 8))),
          CalendarEvent(
              title: 'Third Event',
              eventBarSize: EventBarSize.large,
              start: DateTime.now().subtract(const Duration(days: 3)),
              end: DateTime.now().add(const Duration(days: 10)))
        ],
      )

BarCalendar

CalendarEvent objects must be wrapped in a BarCalendar.

PropertiesDescription
Color backgroundColorThe background color of the calendar.
CalendarHeaderDecoration headerDecorationAn object that allows full header customisation.
List<CalendarEvent> eventsA list of events to display.
double borderRadiusDefined the border radius for the calendar.

CalendarHeaderDecoration

An object that allows full header customisation.

PropertiesDescription
Color? backgroundColorThe background color of the header (default: Colors.white).
TextStyle? dayTextStyle applied to the day of month (number).
TextStyle? dayTextStyle applied to the day of (letter).
TextStyle? dayTextStyle applied to the month of (when calendar is in condensed view).

CalendarEvent

The CalendarEvent object includes information on the events displayed in the calendar.

PropertiesDescription
String titleThe event title, displayed on the calendar.
Color? colorThe background color for the event bar (default: Colors.white).
DateTime? startEvent start date - if set to null, it is assumed the event has an indefinite start date in the past.
DateTime? endEvent end date - if set to null, it is assumed the event has an indefinite end date in the future.
EventBarDecoration? decorationAn object that allows further customisation of the event bar.
EventBarSize eventBarSizeDefines whether the event should be shown in a large or small bar.
List<CalendarEvent> eventsA list of events to display.

EventBarDecoration

An object that allows further customisation of an event bar.

PropertiesDescription
TextStyle? mainTextStyle for the event tytle.
TextStyle? datesTextStyle for the event subtitle.
Icon? iconAn icon to show before the event subtitle (default: Icons.flag).
Color? progressionBarColorColor of the event progression bar.

Libraries

bar_calendar