Skip to content

Modern calendar widget with useful features. Enables to develop well designed calendar in a moment.

License

Notifications You must be signed in to change notification settings

naiksan-1020/cell_calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cell_calendar

pub package License: MIT

Modern calendar widget with useful features. Enables to develop well designed calendar in a moment.

Inspired by the UI of Google Calendar

cell_calendar

Usage

  • Events

You can show the events in the calendar by inserting the list of CalendarEvent as events

    CellCalendar(
      events: [
        CalendarEvent(eventName: "Event 1",eventDate: DateTime1),
        CalendarEvent(eventName: "Event 2",eventDate: DateTime2),
      ]
    );

If you need to customize the calendar more, the additional parameters like eventBackGroundColor, eventTextColor and eventID are helpful.

  • onPageChanged

The callback onPageChanged is literally called when the current page is changed.

    CellCalendar(
      onPageChanged: (firstDate, lastDate) {
        print("This is the first date of the new page: $firstDate");
        print("This is the last date of the new page: $lastDate");
      }
    );

In this sample code, firstDate is the date in the very first cell of the new page, and its logic is same as lastDate.

  • onCellTapped

The callback onCellTapped is called when user tapped a cell.

    CellCalendar(
      onCellTapped: (date) {
        print("$date is tapped !");
      }
    );

It is called with tapped DateTime, so you can get the events on the date if you want.

    CellCalendar(
      onCellTapped: (date){
        print("$date is tapped !");
        final eventsOnTheDate = sampleEvents().where((event) {
          final eventDate = event.eventDate;
          return eventDate.year == date.year &&
              eventDate.month == date.month &&
              eventDate.day == date.day;
        }).toList();
        /// ex) Show dialog or navigate to new page with [eventsOnTheDate]
      }
    );

If you have any requests, questions, or problems, please feel free to ask on github.

About

Modern calendar widget with useful features. Enables to develop well designed calendar in a moment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 98.2%
  • Swift 1.3%
  • Other 0.5%