• Stars
    star
    370
  • Rank 111,707 (Top 3 %)
  • Language
    Dart
  • License
    MIT License
  • Created almost 3 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Flutter package allows you to easily implement all calendar UI and calendar event functionality. 👌🔝🎉

Plugin Banner

calendar_view

Build calendar_view

A Flutter package allows you to easily implement all calendar UI and calendar event functionality.

For web demo visit Calendar View Example.

Preview

Preview

Installing

  1. Add dependencies to pubspec.yaml

    Get the latest version in the 'Installing' tab on pub.dev

    dependencies:
        calendar_view: <latest-version>
  2. Run pub get.

    flutter pub get
  3. Import package.

    import 'package:calendar_view/calendar_view.dart';

Implementation

  1. Wrap MaterialApp with CalendarControllerProvider and assign EventController to it.

    CalendarControllerProvider(
        controller: EventController(),
        child: MaterialApp(
            // Your initialization for material app.
        ),
    )
  2. Add calendar views.

    For Month View

    Scaffold(
        body: MonthView(),
    );

    For Day View

    Scaffold(
        body: DayView(),
    );

    For Week view

    Scaffold(
        body: WeekView(),
    );

    For more info on properties visit documentation .

  3. Use controller to add or remove events.

    To Add event:

    final event = CalendarEventData(
        date: DateTime(2021, 8, 10),
        event: "Event 1",
    );
    
    CalendarControllerProvider.of(context).controller.add(event);

    To Add events in range of dates:

    final event = CalendarEventData(
            date: DateTime(2021, 8, 10),
            endDate: DateTime(2021,8,15),
            event: "Event 1",
        );
    
        CalendarControllerProvider.of(context).controller.add(event);

    To Remove event:

    CalendarControllerProvider.of(context).controller.remove(event);

    As soon as you add or remove events from the controller, it will automatically update the calendar view assigned to that controller. See, Use of EventController for more info

  4. Use GlobalKey to change the page or jump to a specific page or date. See, Use of GlobalKey for more info.

More on the calendar view

Optional configurations/parameters in Calendar view

For month view

MonthView(
    controller: EventController(),
    // to provide custom UI for month cells.
    cellBuilder: (date, events, isToday, isInMonth) {
        // Return your widget to display as month cell.
        return Container();
    },
    minMonth: DateTime(1990),
    maxMonth: DateTime(2050),
    initialMonth: DateTime(2021),
    cellAspectRatio: 1,
    onPageChange: (date, pageIndex) => print("$date, $pageIndex"),
    onCellTap: (events, date) {
        // Implement callback when user taps on a cell.
        print(events);
    },
    startDay: WeekDays.sunday, // To change the first day of the week.
    // This callback will only work if cellBuilder is null.
    onEventTap: (event, date) => print(event),
    onDateLongPress: (date) => print(date),
);

For day view

DayView(
    controller: EventController(),
    eventTileBuilder: (date, events, boundry, start, end) {
        // Return your widget to display as event tile.
        return Container();
    },
    fullDayEventBuilder: (events, date) {
        // Return your widget to display full day event view.
        return Container();
    },
    showVerticalLine: true, // To display live time line in day view.
    showLiveTimeLineInAllDays: true, // To display live time line in all pages in day view.
    minDay: DateTime(1990),
    maxDay: DateTime(2050),
    initialDay: DateTime(2021),
    heightPerMinute: 1, // height occupied by 1 minute time span.
    eventArranger: SideEventArranger(), // To define how simultaneous events will be arranged.
    onEventTap: (events, date) => print(events),
    onDateLongPress: (date) => print(date),
);

For week view

WeekView(
    controller: EventController(),
    eventTileBuilder: (date, events, boundry, start, end) {
        // Return your widget to display as event tile.
        return Container();
    },
    fullDayEventBuilder: (events, date) {
        // Return your widget to display full day event view.
        return Container();
    },
    showLiveTimeLineInAllDays: true, // To display live time line in all pages in week view.
    width: 400, // width of week view.
    minDay: DateTime(1990),
    maxDay: DateTime(2050),
    initialDay: DateTime(2021),
    heightPerMinute: 1, // height occupied by 1 minute time span.
    eventArranger: SideEventArranger(), // To define how simultaneous events will be arranged.
    onEventTap: (events, date) => print(events),
    onDateLongPress: (date) => print(date),
    startDay: WeekDays.sunday, // To change the first day of the week.
);

To see the list of all parameters and detailed description of parameters visit documentation .

Use of EventController

EventController is used to add or remove events from the calendar view. When we add or remove events from the controller, it will automatically update all the views to which this controller is assigned.

Methods provided by EventController

Name Parameters Description
add CalendarEventData<T> event Adds one event in controller and rebuilds view.
addAll List<CalendarEventData<T>> events Adds list of events in controller and rebuilds view.
remove CalendarEventData<T> event Removes an event from controller and rebuilds view.
getEventsOnDay DateTime date Returns list of events on date

Use of GlobalKey

User needs to define global keys to access functionalities like changing a page or jump to a specific page or date. Users can also access the controller assigned to respected view using the global key.

By assigning global keys to calendar views you can access methods and fields defined by state class of respected views.

Methods defined by MonthViewState class:

Name Parameters Description
nextPage none Jumps to next page.
previousPage none Jumps to the previous page.
jumpToPage int page Jumps to page index defined by page.
animateToPage int page Animate to page index defined by page.
jumpToMonth DateTime month Jumps to the page that has a calendar for month defined by month
animateToMonth DateTime month Animate to the page that has a calendar for month defined by month

Methods defined by DayViewState class.

Name Parameters Description
nextPage none Jumps to next page.
previousPage none Jumps to the previous page.
jumpToPage int page Jumps to page index defined by page.
animateToPage int page Animate to page index defined by page.
jumpToDate DateTime date Jumps to the page that has a calendar for month defined by date
animateToDate DateTime date Animate to the page that has a calendar for month defined by date
animateToEvent CalendarEventData event Animates to the page where a given event is and then scrolls to make that event visible on the screen.
jumpToEvent CalendarEventData event Jumps to the page where a given event is and then scrolls to make that event visible on the screen.

Methods defined by WeekViewState class.

Name Parameters Description
nextPage none Jumps to next page.
previousPage none Jumps to the previous page.
jumpToPage int page Jumps to page index defined by page.
animateToPage int page Animate to page index defined by page.
jumpToWeek DateTime week Jumps to the page that has a calendar for month defined by week
animateToWeek DateTime week Animate to the page that has a calendar for month defined by week
animateToEvent CalendarEventData event Animates to the page where a given event is and then scrolls to make that event visible on the screen.
jumpToEvent CalendarEventData event Jumps to the page where a given event is and then scrolls to make that event visible on the screen.

Synchronize events between calendar views

There are two ways to synchronize events between calendar views.

  1. Provide the same controller object to all calendar views used in the project.
  2. Wrap MaterialApp with CalendarControllerProvider and provide controller as argument as defined in Implementation.

Show only working days in WeekView.

You can configure week view such that it displays only specific days. ex,

WeekView(
  weekDays: [
    WeekDays.monday,
    WeekDays.tuesday,
    WeekDays.wednesday,
    WeekDays.thursday,
    WeekDays.friday,
  ],
);

Above code will create WeekView with only five days, from monday to friday.

Main Contributors


Vatsal Tanna

Sanket Kachhela

Parth Baraiya

Ujas Majithiya

Ankit Panchal

Mehul Kabaria

Faiyaz Shaikh

Awesome Mobile Libraries

License

MIT License

Copyright (c) 2021 Simform Solutions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

More Repositories

1

flutter_showcaseview

Flutter plugin that allows you to showcase your features on flutter application. 👌🔝🎉
Dart
1,370
star
2

SSComposeCookBook

A Collection of major Jetpack compose UI components which are commonly used.🎉🔝👌
Kotlin
577
star
3

SSCustomTabbar

Simple Animated tabbar with native control
Swift
559
star
4

SSCustomBottomNavigation

Animated TabBar with native control and Jetpack Navigation support..✨🔖🚀
Kotlin
476
star
5

SSSpinnerButton

Forget about typical stereotypic loading, It's time to change. SSSpinnerButton is an elegant button with a different spinner animations.
Swift
428
star
6

flutter_credit_card

A credit card widget for Flutter application.
Dart
385
star
7

SSffmpegVideoOperation

This is a library of FFmpeg for android... 📸 🎞 🚑
Kotlin
340
star
8

SSToastMessage

SSToastMessage is written purely in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.
Swift
280
star
9

SSJetPackComposeProgressButton

SSJetPackComposeProgressButton is an elegant button with a different loading animations. 🚀
Kotlin
265
star
10

ARKit2.0-Prototype

After Apple’s introduction of ARKit 2, we have been consistently working behind to create shared-AR experiences. Our goal is to improve the utility of mobile using AR experiences.
Swift
261
star
11

SSImagePicker

Easy to use and configurable library to Pick an image from the Gallery or Capture an image using a Camera... 📸
Kotlin
261
star
12

audio_waveforms

Use this plugin to generate waveforms while recording audio in any file formats supported by given encoders or from audio files. We can use gestures to scroll through the waveforms or seek to any position while playing audio and also style waveforms
Dart
234
star
13

SSCustomEditTextOutLineBorder

Same as the Outlined text fields presented on the Material Design page but with some dynamic changes. 📝 🎉
Kotlin
206
star
14

flutter_chatview

Highly customisable chat UI with reply and reaction functionality.
Dart
198
star
15

Awesome-Mobile-Libraries

This repo contains all the Open-source Libraries from iOS, Android, Flutter and React-Native.✨
170
star
16

react-native-story-view

A React Native component to show image and video stories ✨ 🎖
TypeScript
170
star
17

react-native-reactions

A React Native animated reaction picker component ✨✨
TypeScript
134
star
18

react-native-radial-slider

React Native component to select or highlight a specific value from a range of values 👌 ✨
TypeScript
130
star
19

SSPullToRefresh

SSPullToRefresh makes PullRefresh easy to use, you can provide your own custom animations or set simple gifs on refresh view. The best feature is Lottie animations in refresh view, it uses lottie animations to render high quality animations on pull refresh. 🎉💥
Kotlin
114
star
20

react-native-spinner-button

React Native button component with multiple animated spinners
JavaScript
106
star
21

SSBiometricsAuthentication

Biometric factors allow for secure authentication on the Android platform.
Kotlin
102
star
22

SSComposeShowCaseView

SSComposeShowCaseView is a customizable show case view library in Jetpack compose which allows to showcase/highlight the particular features of the application with an engaging overlay. It also provides automatic showcase view feature with customised delay and opacity attributes. 🎉💥
Kotlin
94
star
23

SSJetpackComposeSwipeableView

SSJetpackComposeSwipeableView is a small library which provides support for the swipeable views. You can use this in your lazyColumns or can add a simple view which contains swipe to edit/delete functionality.
Kotlin
91
star
24

react-native-animation-catalog

A collection of animated React Native components 🌟🔥
TypeScript
90
star
25

Kotlin-multiplatform-sample

A sample Kotlin Multiplatform project having native UI and shared bussiness logic on Android and iOS platforms.
Kotlin
84
star
26

SSCustomTabMenu

Customisable iOS bottom menu works like Tabbar
Swift
80
star
27

SSAndroidNeumorphicKit

Neomorphic UI kit for Android
Kotlin
72
star
28

SSCustomPullToRefresh

SSCustomPullToRefresh is an open-source library that uses UIKit to add an animation to the pull to refresh view in a UITableView and UICollectionView.
Swift
69
star
29

SSAppUpdater

SSAppUpdater is an open-source framework that compares the current version of the app with the store version and returns the essential details of it like app URL, new app version number, new release note, etc. So you can either redirect or notify the user to update their app.
Swift
67
star
30

SSStepper

SwiftUI package for creating custom stepper with gesture controls and flexible design as per your choice.
Swift
65
star
31

VonageVideoCalling_Android

Vonage Video Calling Android
Kotlin
63
star
32

SSExpandableRecylerView

Expandable Recyclerview makes it easy to integrate nested recycler view...🔨 📝
Kotlin
59
star
33

SSCustomSideMenu

Side Menu Custom Control for iOS apps
Swift
55
star
34

react-native-skia-catalog

A collection of animated React Native Skia components 🌟
TypeScript
54
star
35

SSSwiftUIGIFView

SSSwiftUIGIFView is a custom controller which helps to load GIF in SwiftUI.
Swift
53
star
36

SSArcSeekBar

Different type of arc seekbar. Easy to use and configure your own seekbar using all the attributes.
Kotlin
52
star
37

SSComposeOTPPinView

A custom OTP view to enter a code usually used in authentication. It includes different types of OTPViews which is easy to use and configure your own view and character of OTP using all the attributes. 📲 🔢 ✨
Kotlin
50
star
38

SSPlaceHolderTableView

SSPlaceholderTableView is Placeholder Library for different different state wise placeHolder for UITableView/UICollectionView. Check https://www.cocoacontrols.com/controls/ssplaceholdertableview
Swift
50
star
39

SSFloatingLabelTextField

Swift
44
star
40

SSLineChart

SSLineChart provides you with the additional functionality of gradient color fill which cannot be found in any library specially Watchkit Libraries.
Swift
44
star
41

SSSwiftUISpinnerButton

SSSwiftUISpinnerButton is a collection of various spinning animations for buttons in SwiftUI.
Swift
43
star
42

react-native-tree-selection

A high-performance and lightweight tree selection library for React Native🎖
TypeScript
42
star
43

SSNaturalLanguage

Swift
42
star
44

react-native-photos-gallery

A React Native custom animated photo gallery component to open and view photos ✨
TypeScript
41
star
45

react-native-country-code-select

A React Native component that allows users to select a country code ✨ 🔥
TypeScript
41
star
46

Jetpack-compose-sample

Forget about bunch of XML files for maintaining UIs. Jetpack Compose is Android’s modern toolkit for building native UI. Here is a small example to get started.
Kotlin
38
star
47

SSMediaLibrary

Swift
38
star
48

SSVerticalPanoramaImage

Capture stunning vertical panorama images with ease and preview them instantly on the built-in screen.
Swift
37
star
49

SSCircularSlider

A simple, powerful and fully customizable circular slider, written in swift.
Swift
37
star
50

react-native-images-preview

A React Native animated custom image preview component ✨
TypeScript
36
star
51

SSCalendarControl

SSCalendarControl is small and highly customizable calendar control written in swift.
Swift
35
star
52

SSNeumorphicKit

Swift
35
star
53

SSSwiftyGo

Swift
35
star
54

flutter_vonage_video_call_demo

This application provides demo of one to one video call using Vonage Video API. Since there is no office support for flutter from voyage, this demo uses platform channel to communicate with native voyage SDK.
Kotlin
35
star
55

SSMultiSwipeCellKit

Swift
34
star
56

react-native-sticky-table

React Native sticky table component to elevate the app's data presentation and visualization experience ✨
TypeScript
32
star
57

react-native-audio-waveform

React Native component to show audio waveform with ease in react native application ✨
TypeScript
32
star
58

SSSwiper

SSSwiper is used to create swipe gestures action inside any view just by adding a modifier to the View with various customization options
Swift
31
star
59

Fitness-App-ARKit

Fitness App build with ARKit.
Swift
30
star
60

tesseract-OCR-iOS-demo

This prototype is to recognize text inside the image and for that it uses Tesseract OCR. The underlying Tesseract engine will process the picture and return anything that it believes is text.
Swift
30
star
61

SSStoryStatus

SSStoryStatus: Elevate your SwiftUI projects with seamless user list integration and captivating story displays. Empowering developers with effortless integration and complete UI customization, this versatile library makes showcasing stories a breeze.
Swift
28
star
62

SSSwiftUISideMenu

SSSwiftUISideMenu: Your ultimate iOS side menu companion. This customizable and intuitive library facilitates seamless navigation within your app, offering left and right panel support. Effortlessly integrate and personalize UI elements and animation styles to elevate your user experience.
Swift
26
star
63

SSInstaFeedParser

A Flutter package allows you to fetch basic data from a Instagram profile url which is public and verified.
Dart
25
star
64

react-native-graph-kit

Personalized graphs featuring customizable options for React Native app 📈
TypeScript
23
star
65

SSFacebookLogin

The Reusable Facebook Login Components for iOS is the easiest way to get data from Facebook.
Swift
22
star
66

battleship_flutter_flame

Dart
20
star
67

SSSceneFormSdkSample

This is an Augmented Reality Android app that is made by using ARcore and Sceneform SDK. 📸 🎉
Kotlin
18
star
68

Kotlin-Extensions

Library contains common extensions for Android
Kotlin
15
star
69

SSSwiftUILoader

A customisable, simple and elegant loader in SwiftUI.
Swift
15
star
70

SSSwiftUIVideoLayerView

SSSwiftUIVideoPlayerLayer is a custom controller which helps to load video in SwiftUI.
Swift
14
star
71

SSProgressBar

Customizable progressbar
Swift
14
star
72

SSGoogleLogin

The GoogleSigninReusabelComponets for iOS is the easiest way to get data from Google .
Swift
14
star
73

CMPedometerDemo

Let's count steps using CMPedometer
Swift
14
star
74

SSAudioRecorderWithWaveForm

SSAudioRecorderWithWaveForm is recording audio with wave form. 🎉🎤
Kotlin
13
star
75

SSCustomCameraControl

Custom camera control
Kotlin
12
star
76

CreateFirebaseDynamicLinks

Swift
10
star
77

ios-commons

added few old helpers (need to updated) as initial version to work on
Swift
9
star
78

SSTwitterLogin

The reusable Twitter login components for iOS is the easiest way to get data from Twitter.
Swift
9
star
79

Workouts-TV-app

Swift
8
star
80

Game-With-AR

Swift
8
star
81

flutter_project_template

Dart
7
star
82

SSLinkedIn

Objective-C
7
star
83

MVVMListDemo

Swift
7
star
84

iOS-BarcodeScan

Objective-C
6
star
85

android-demos

Kotlin
5
star
86

SSSwiftUIVideoPlayerLayer

Swift
4
star
87

react-native-downloader

A audio video file downloader app with foreground and background download support
JavaScript
4
star
88

flutter_ss_placeholder_view

A Flutter package allows you to add placeholder content while loading or empty items.🚧
Dart
4
star
89

NewsApp-RIBs

News app with Listview and Pageview using uber's RIBs Architecture
Swift
3
star
90

SwiftUI-Combine-MVVM

Swift
3
star
91

MVVMDemo

Architecture of iOS Application, Swift
Swift
2
star
92

BiometricReactNative

Biometric authentication with react-native app
JavaScript
2
star
93

Kotlin-CoRoutines

Kotlin
2
star
94

DFPDemo

For showing Ad's , Swift
Swift
2
star
95

QualityCodeSample

Swift
2
star
96

Android_Project_Setup

Kotlin
2
star
97

GoogleLogin

Swift
2
star
98

android_simform_sample_app

The sample app uses Github's GraphQL APIs to query the Simform's Github repositories and list them using compose views in the Android application.
Kotlin
2
star
99

SSNeumorphicSwiftUIKit

1
star
100

react-native-saga-operations

Repository for Redux-saga operations
JavaScript
1
star