Skip to main content

flexi_calendar 0.0.1 copy "flexi_calendar: ^0.0.1" to clipboard
flexi_calendar: ^0.0.1 copied to clipboard

A lightweight, configurable Flutter calendar widget focused on clarity, flexibility, and real-world use cases.

Flutter FlexiCalendar #

FlexiCalendar Banner

The Custom Calendar package is a flexible and highly customizable date picking library natively written in Dart for creating beautiful and high-performance calendar views, which are used to craft high-quality mobile app user interfaces using Flutter.

Overview #

Create various types of calendar views with seamless interaction, responsiveness, and smooth scrolling. It has a rich set of features, and it is completely customizable and extendable.

This flexi_calendar package includes the following primary widget:

  • FlexiCalendar

Table of contents #

Calendar features #

  • Selection Modes - Provides functionality for Single date selection, Date Range selection, and Multiple independent dates selection. Selection Modes

  • Views - Plot various amounts of days in the graph with the help of Month view and Week view. Calendar Views

  • User interaction - The end-user experience is greatly enhanced by including horizontal swipe gestures to smoothly navigate between different months or weeks based on the selected view. User Interaction

  • Date Constraints - Prevent selection of invalid dates dynamically with firstDate, lastDate, disablePastDates, and disableFutureDates.

  • Custom Builders - Wrap the Header and Body of the calendar inside your own custom containers with full programmatic layout integration.

Installation #

Install the latest version from your pubspec.yaml dependencies:

dependencies:
  flexi_calendar: ^0.0.1

Calendar getting started #

Import the following package.

import 'package:flexi_calendar/flexi_calendar.dart';

Add calendar to the widget tree #

Add the calendar widget as a child of any widget. Here, the calendar widget is added as a child of container widget.

@override
Widget build(BuildContext context) {
  return Scaffold(
      body: Center(
          child: Container(
              child: FlexiCalendar()
          )
      )
  );
}

Bind configuration #

Based on data, initialize the appropriate config type for selection modes, first dates, and max dates.

@override
Widget build(BuildContext context) {
  return Scaffold(
      body: Center(
          child: Container(
              child: FlexiCalendar(
                config: CalendarConfig(
                  firstDate: DateTime(2020),
                  lastDate: DateTime(2030),
                  selectionMode: CalendarSelectionMode.range,
                  themeColor: Colors.blue,
                ),
                onRangeSelected: (range) {
                  print("Selected Range: ${range.start} - ${range.end}");
                },
              )
          )
      )
  );
}

Add event elements #

Add the calendar event elements such as dots to display additional information about the date plotted in the calendar.

@override
Widget build(BuildContext context) {
  return Scaffold(
      body: Center(
          child: Container(
              child: FlexiCalendar(
                config: CalendarConfig(
                  firstDate: DateTime(2020),
                  lastDate: DateTime(2030),
                ),
                events: {
                  DateTime(2026, 2, 3): [
                    CalendarEvent(color: Colors.red),
                    CalendarEvent(color: Colors.green),
                  ],
                  DateTime(2026, 2, 10): [
                    CalendarEvent(color: Colors.blue),
                  ],
                },
              )
          )
      )
  );
}

Additional Configurations (CalendarConfig) #

You can pass the following parameters to CalendarConfig for further customization:

Parameter Type Default Description
firstDate DateTime Required The earliest acceptable date in the calendar.
lastDate DateTime Required The latest acceptable date in the calendar.
selectionMode CalendarSelectionMode .single .single, .range, or .multiple.
calendarView CalendarView .month Toggle between .month and .week.
autoSelectToday bool false Automatically highlights today's date on initialized.
disablePastDates bool false Greys out dates before today.
disableFutureDates bool false Greys out dates after today.
startWeekOn int DateTime.sunday Which day the week starts on.
allowSwipe bool true Navigates between months/weeks with gestures.
themeColor Color? null Theme color for selected day highlights.
textStyles CalendarTextStyles Default Allows deep styling of headers and day views.

Support and Feedback #

  • For any other queries, submit a feature request or a bug through our GitHub repository.

License #

WhiteOrangeSoftware.

0
likes
150
points
34
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A lightweight, configurable Flutter calendar widget focused on clarity, flexibility, and real-world use cases.

Repository (GitHub)

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on flexi_calendar