Clean, beautiful and customisable calendar package for flutter

Overview

pub package wakatime

Word from creator

Hello ๐Ÿ‘‹ , Yeah I know Clean calendar is still very new, but don't be put off by it because it will be well-maintained for a very, very long time. It is in the early stages of development. And additionally, you can contact me via email, discord, or any of the other channels provided on my Github profile if you have any questions or suggestions about this package.

Yes, without a doubt, giving a ๐Ÿ‘ or โญ will encourage me to work on this package more quickly ๐Ÿฐ .

Package description

A brand-new Flutter calendar package that enables you to make a simple, lovely, and customizable calendar. It now offers a customizable month view and the choice to display unique streaks for dates. It is actively being developed to add numerous common features, like events, date selection, and many more, so this is just the beginning.

Features

  • Give a list of dates so that the calendar can display them as streaks.

  • Calendar with custom monthly view.
Dark mode Gif Light mode Gif
  • Calendar with custom weekly view.
Dark mode Gif Light mode Gif

Getting started

  • In pubspec.yaml, add this dependency:
clean_calendar: 
  • Add this package to your project:
import 'package:clean_calendar/clean_calendar.dart';

Basic Usage

class Home extends StatelessWidget {
  const Home({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 2,
        title: const Text("Calendar"),
      ),
      body: CleanCalendar(
        datesForStreaks: [
          DateTime(2022, 8, 5),
          DateTime(2022, 8, 6),
          DateTime(2022, 8, 7),
          DateTime(2022, 8, 9),
          DateTime(2022, 8, 10),
          DateTime(2022, 8, 11),
          DateTime(2022, 8, 13),
          DateTime(2022, 8, 20),
          DateTime(2022, 8, 21),
          DateTime(2022, 8, 23),
          DateTime(2022, 8, 24),
        ],
      ),
    );
  }
}

Customisations

  • Customise date boundary behaviour and tap behaviour
CleanCalendar(                           
)
CleanCalendar(
// To allow date boundary to shrink.
enableDenseViewForDates: true,

// To allow date tap splash to shrink.
enableDenseSplashForDates: true,
)
  • Disable and hide different types of dates
CleanCalendar(                                      
)
CleanCalendar(
leadingTrailingDatesProperties: DatesProperties(

// To disable taps on leading and trailing dates.
disable: true,

// To hide leading and trailing dates.
hide: true,
),
)

Also, Available for other types of dates : -

Selected Dates Visible Month Dates Current Date Streak Dates
CleanCalendar(
selectedDatesProperties: DatesProperties(

// To disable taps on selected dates.
disable: true,

// To hide selected dates.
hide: true,
),
)
CleanCalendar(
generalDatesProperties: DatesProperties(

// To disable taps on leading and trailing dates.
disable: true,

// To hide leading and trailing dates.
hide: true,
),
)
CleanCalendar(
currentDateProperties: DatesProperties(

// To disable taps on current date.
disable: true,

// To hide current date.
hide: true,
),
)
CleanCalendar(
streakDatesProperties: DatesProperties(

// To disable taps on streak dates.
disable: true,

// To hide streak dates.
hide: true,
),
)
  • Customise dates look by changing its properties
CleanCalendar(                                         
);
CleanCalendar(
datesForStreaks: [
DateTime(2022, 8, 5),
DateTime(2022, 8, 6),
...
],
currentDateProperties: DatesProperties(
decorationProperties: DecorationProperties(
datesBorderRadius: 1000,
datesBackgroundColor: Colors.lightGreen.shade100,
datesBorderColor: Colors.green,
datesTextColor: Colors.black,
),
),
generalDatesProperties: DatesProperties(
decorationProperties: DecorationProperties(
datesBorderRadius: 1000,
datesBackgroundColor: Colors.lightGreen.shade100,
datesBorderColor: Colors.blue.shade100,
datesTextColor: Colors.black,
),
),
streakDatesProperties: DatesProperties(
decorationProperties: DecorationProperties(
datesBorderRadius: 1000,
datesBackgroundColor: Colors.green,
datesBorderColor: Colors.blue,
datesTextColor: Colors.white,
),
),
leadingTrailingDatesProperties: DatesProperties(
decorationProperties: DecorationProperties(
datesBorderRadius: 1000,
),
),
)
CleanCalendar(
enableDenseViewForDates: true,
datesForStreaks: [
DateTime(2022, 8, 5),
DateTime(2022, 8, 6),
...
],
currentDateProperties: DatesProperties(
decorationProperties: DecorationProperties(
datesBorderRadius: 1000,
datesBackgroundColor: Colors.lightGreen.shade100,
datesBorderColor: Colors.green,
datesTextColor: Colors.black,
),
),
generalDatesProperties: DatesProperties(
decorationProperties: DecorationProperties(
datesBorderRadius: 1000,
datesBackgroundColor: Colors.lightGreen.shade100,
datesBorderColor: Colors.blue.shade100,
datesTextColor: Colors.black,
),
),
streakDatesProperties: DatesProperties(
decorationProperties: DecorationProperties(
datesBorderRadius: 1000,
datesBackgroundColor: Colors.green,
datesBorderColor: Colors.blue,
datesTextColor: Colors.white,
),
),
leadingTrailingDatesProperties: DatesProperties(
decorationProperties: DecorationProperties(
datesBorderRadius: 1000,
),
),
)

Date Selection

  • Single date selection with customization
CleanCalendar(
enableDenseViewForDates: true,
enableDenseSplashForDates: true,
datesForStreaks: [
DateTime(2022, 8, 5),
DateTime(2022, 8, 6),
...
],

// Selecting single date selection mode. Defaults to disable selection.
dateSelectionMode: DatePickerSelectionMode.single,

// Customizing selected date.
selectedDatesProperties: DatesProperties(
decorationProperties: DecorationProperties(
datesBorderRadius: 1000,
),
),
)
  • Multiple, range, multiple ranges (coming soon)

Changing calendar view type

Currently mothly and weekly views are added. You can change them as shown below:

CleanCalendar(
  // Setting DatePickerCalendarView.weekView for weekly view
  datePickerCalendarView: DatePickerCalendarView.weekView,
)

Note: datePickerCalendarView defaults to DatePickerCalendarView.monthView.

Accessing selected dates

To access selected dates use the onSelectedDates callback but keep in mind that this callback always provides a list of dates as shown below:

CleanCalendar(
  ...
  onSelectedDates: (List<DateTime> selectedDates) {
    // Called every time dates are selected or deselected.
    print(selectedDates);
  },
)

Note: Even for single selection mode it provides a list with just one date and for multiple selection it provides a list with multiple dates.

Providing pre-selected dates

You can provide pre-selected dates by providing a list of dates to selectedDates as shown below:

CleanCalendar(
  ...
  selectedDates: [
    DateTime(2022, 8, 6),
    DateTime(2022, 8, 9),
    DateTime(2022, 8, 11),
  ],
)

Note: Even with selection mode set to single or disable it will still show the provided pre-selected dates as selected. And I think is the correct behavious as sometimes we might want to show selected dates while also preventing users from interacting with them.

Providing start and end dates

You can provide start and end dates for calendar view as shown below:

CleanCalendar(
  ...
  // Setting start date of calendar.
  startDateOfCalendar: DateTime(2022,6,5),

  // Setting end date of calendar.
  endDateOfCalendar: DateTime(2022,10,15),
)

Note: startDateOfCalendar defaults to DateTime.utc(0000, 1, 1) and endDateOfCalendar defaults to DateTime.utc(9999, 1, 1).

Providing initial month view for calendar

You can provide initial month view for calendar by providing date of that month as shown below:

CleanCalendar(
  ...
  // Setting initial month view of calendar.
  initialViewMonthDateTime: DateTime(2022,9,5),
)

Note: initialViewMonthDateTime defaults to current date and if current is not between startDateOfCalendar and endDateOfCalendar then defaults to start date..

Providing current date for calendar

You can provide current date for calendar as shown below:

CleanCalendar(
  ...
  // Setting current date of calendar.
  currentDateOfCalendar: DateTime(2022,9,5),
)

Note: currentDateOfCalendar defaults to DateTime.now().

Listening for calendar view week or month change

You can listen and get the current calendar view date on calendar view change. Useful in case you want to change your ui acording to the dates visible to user.

CleanCalendar(
  ...
  onCalendarViewDate: (DateTime calendarViewDate) {
    // Called every time view is changed like scrolled etc.
    print(calendarViewDate);
  },
)

Note: For now onCalendarViewDate will only provide the view starting date. Later I may can add an option to get all dates of current view depending on users request. Also, onCalendarViewDate is called only on change of view like scroll, etc and will not be called on the creation of calendar as at thst time we already know the date.

Additional information

Support is surely planned for these:

  • Complete documentation.

  • Option to disable user interactions on whole view, past dates, and dates after-before end-start date. ( ๐Ÿ‡ )

  • More customization and premade templates for calendar. ( ๐Ÿข )

  • More calendar view types. ( ๐Ÿข )

  • Date selection options such as multiple, range, and multiple range selections. ( ๐Ÿข )

  • A calendar option for choosing a view by year, month, or day. ( ๐Ÿข )

  • Support for dates to be displayed in events style. ( ๐Ÿข )

  • Dry mode, which optimizes performance for low-end devices by removing or substituting heavy animations and widgets. ( ๐Ÿข )

And, if I'm forgetting something crucial/important/necessary then please let me know.

You might also like...

Custom calendar dialog widget for flutter with (multi select, single select, date range) mode

Custom calendar dialog widget for flutter with (multi select, single select, date range) mode

some calendar Custom calendar with Multi-select & range configurable calendar New Features Added View Mode Somecalendar #15 Help Maintenance I've take

Jan 3, 2023

Calendar application writtern in flutter/dart.

Calendar application writtern in flutter/dart.

Flutter Application A new Flutter application implementing a simple mobile calendar app for storing basic events into Firebase cloud database. Google

Sep 13, 2022

Nepali date picker - Material Style Date Picker with Bikram Sambat(Nepali) Calendar Support

Nepali date picker - Material Style Date Picker with Bikram Sambat(Nepali) Calendar Support

Nepali Date Picker + Calendar Material and Cupertino Styled Date Picker, Date Range Picker and Calendar with Bikram Sambat(Nepali) Support. Nepali Dat

Jan 3, 2023

The flutter_calendar_widget is highly customizable calendar widget.

The flutter_calendar_widget is highly customizable calendar widget.

flutter_calendar_widget The flutter_calendar_widget is highly customizable calendar widget. Not only can you change the style, but you can also change

Jun 24, 2022

Package provides light widgets [for Linkify, Clean] and extensions for strings that contain bad words/URLs/links/emails/phone numbers

Package provides light widgets [for Linkify, Clean] and extensions for strings that contain bad words/URLs/links/emails/phone numbers

Package provides light widgets [for Linkify, Clean] and extensions for strings that contain bad words/URLs/links/emails/phone numbers

Oct 2, 2022

Dart package responsible to provide the basic resources to Lambda Functions with Clean Dart

AWS Lambda Core This package is responsible to provide the basic resources to all services; Usage pubspec.yaml dependencies: aws_lambda_core: laste

Dec 2, 2021

A beautiful and customizable Star Rating Dialog package for Flutter

A beautiful and customizable Star Rating Dialog package for Flutter

rating_dialog A beautiful and customizable Rating Dialog package for Flutter! Supports all platforms that flutter supports! Import the rating_dialog p

Jul 13, 2022

A Flutter package to make and use beautiful color scheme based themes.

A Flutter package to make and use beautiful color scheme based themes.

FlexColorScheme Use FlexColorScheme to make beautiful color scheme based Flutter themes, with optional primary color surface blends. The themes are ba

Jan 1, 2023

Flutter project to find and discover events with Clean Architecture and Bloc from SeatGeek API.

Flutter project to find and discover events with Clean Architecture and Bloc from SeatGeek API.

Dec 6, 2022
Comments
  • Rebuilding Clean_calendar

    Rebuilding Clean_calendar

    Plausible issues due to an STM library in a package:

    • Using an STM library would make it mandatory for the package to work closely with their changes when making an update.
    • Not updating the STM will lead to version solving fails for others on different versions of STM.
    • Leads to unnecessary delays in the package to issues introduced by STM updates containing no breaking changes. (Encountered)

    Possible solution:

    • Make the package independent of other packages if possible.
    • Separately host a copy of the verified version of STM.

    Final verdict: I'm choosing to make this package independent of other packages as maintaining a copy of separate STM would also be a headache whenever major changes were made in a flutter.

    So, finally the package would be rebuilt.

    enhancement 
    opened by chaudharydeepanshu 1
Owner
Deepanshu Chaudhary
App Developer with Flutter, Jetpack Compose, and Kotlin
Deepanshu Chaudhary
A highly customisable and simple widget for having iOS 13 style tab bars.

cupertino_tabbar A highly customisable and simple widget for having iOS 13 style tab bars. It is highly recommended to read the documentation and run

AliYigitBireroglu 98 Oct 31, 2022
A customisable height slider for Flutter.

Height Slider Widget for Flutter โœจ Demo ?? Usage class _MyHomePageState extends State<MyHomePage> { int height = 170; @override Widget build(Bu

Coval Solutions 15 Aug 21, 2021
A Flutter slidable widget that provides an easy to use configuration. Highly customisable. Just as you want it!

A Flutter slidable widget that provides an easy to use configuration. Highly customisable. Just as you want it!

Ravi Kavaiya 89 Dec 8, 2022
Ouday 25 Dec 15, 2022
clean architecture and clean code with flutter , with bloc and getx state managment .

example_bloc A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Khaled ElTohamy 6 Aug 22, 2022
Flutter-clean-architecture - A simple flutter project developed with TDD and using Clean Architecture principles.

Clean Architecture This is a study project to practice TDD and a good approach of Clean Architecture for flutter projects. It is based on Reso Coder s

Luiz Paulo Franz 8 Jul 21, 2022
A new flutter package project which contains lots of beautiful alert dialog that will help you lot to create beautiful awesome alert box very quickly and easily.

A new flutter package project which contains lots of beautiful alert dialog that will help you lot to create beautiful awesome alert box very quickly and easily.

Karan Soni 8 Jan 8, 2022
Booking calendar - Flutter package to manage online bookings

Booking Calendar Want to make online bookings in your app? Then luckily you need

null 35 Dec 18, 2022
๐Ÿ“… Customizable flutter calendar widget including day and week views

?? Customizable, animated calendar widget including day, week, and month views. Navigation Animation Callbacks Changing the VisibleDateRange Available

Jonas Wanke 276 Jan 1, 2023
ๆ— ็ฌฌไธ‰ๆ–นไพ่ต–็š„ๅ…ฌๅŽ†(้˜ณๅŽ†)ๅ’Œๅ†œๅŽ†(้˜ดๅŽ†ใ€่€้ป„ๅŽ†)ๅทฅๅ…ท๏ผŒๆ”ฏๆŒ่Š‚ๅ‡ๆ—ฅใ€ๆ˜Ÿๅบงใ€ๅ„’็•ฅๆ—ฅใ€ๅนฒๆ”ฏใ€็”Ÿ่‚–ใ€่Š‚ๆฐ”ใ€่Š‚ๆ—ฅใ€ๅฝญ็ฅ–็™พๅฟŒใ€ๆฏๆ—ฅๅฎœๅฟŒใ€ๅ‰็ฅžๅฎœ่ถ‹ๅ‡ถ็…žๅฎœๅฟŒใ€ๅ‰็ฅž(ๅ–œ็ฅž/็ฆ็ฅž/่ดข็ฅž/้˜ณ่ดต็ฅž/้˜ด่ดต็ฅž)ๆ–นไฝใ€่ƒŽ็ฅžๆ–นไฝใ€ๅ†ฒ็…žใ€็บณ้Ÿณใ€ๆ˜Ÿๅฎฟใ€ๅ…ซๅญ—ใ€ไบ”่กŒใ€ๅ็ฅžใ€ๅปบ้™คๅไบŒๅ€ผๆ˜Ÿใ€้’้พ™ๅๅ ‚็ญ‰ๅไบŒ็ฅžใ€้ป„้“้ป‘้“ๆ—ฅๅŠๅ‰ๅ‡ถ็ญ‰ใ€‚lunar is a calendar library for Solar and Chinese Lunar.

lunar lunarๆ˜ฏไธ€ๆฌพๆ— ็ฌฌไธ‰ๆ–นไพ่ต–็š„ๅ…ฌๅŽ†(้˜ณๅŽ†)ๅ’Œๅ†œๅŽ†(้˜ดๅŽ†ใ€่€้ป„ๅŽ†)ๅทฅๅ…ท๏ผŒๆ”ฏๆŒๆ˜Ÿๅบงใ€ๅ„’็•ฅๆ—ฅใ€ๅนฒๆ”ฏใ€็”Ÿ่‚–ใ€่Š‚ๆฐ”ใ€่Š‚ๆ—ฅใ€ๅฝญ็ฅ–็™พๅฟŒใ€ๅ‰็ฅž(ๅ–œ็ฅž/็ฆ็ฅž/่ดข็ฅž/้˜ณ่ดต็ฅž/้˜ด่ดต็ฅž)ๆ–นไฝใ€่ƒŽ็ฅžๆ–นไฝใ€ๅ†ฒ็…žใ€็บณ้Ÿณใ€ๆ˜Ÿๅฎฟใ€ๅ…ซๅญ—ใ€ไบ”่กŒใ€ๅ็ฅžใ€ๅปบ้™คๅไบŒๅ€ผๆ˜Ÿใ€้’้พ™ๅๅ ‚็ญ‰ๅไบŒ็ฅžใ€้ป„้“ๆ—ฅๅŠๅ‰ๅ‡ถใ€ๆณ•ๅฎš่Š‚ๅ‡ๆ—ฅๅŠ่ฐƒไผ‘็ญ‰ใ€‚ Eng

6tail 63 Dec 27, 2022