Calendar widget for flutter

Overview

Calendar

Shows a scrolling calendar list of events. This is still relatively basic, it always assumes that the getEvents returns the entire list of calendar events (mostly ignoring the values passed into the source). It does work however :) Optionally, you can use an image as a background for the calendar header and another image for the month header.

The calendar uses slivers to display the widgets in the view and lets you scroll forward and backward through the events. The header widget will drop down and open up the days of the month, letting you select specific days as well as move back and forth between the months. By default it displays a list of events and not a day view, the day view code is all just a stub right now.

Here is how to use the calendar widget itself:

new CalendarWidget(
              initialDate: new TZDateTime.now(local),
              buildItem: buildItem,
              getEvents: getEvents,
            );

How to setup a source for the calendar widget.

...
  List<Game> _listToShow;
  StreamSubscription<UpdateReason> _listening;

  @override
  Widget buildItem(BuildContext context, CalendarEvent event) {
    return new GameCard(_listToShow[event.index]);
  }

  @override
  List<CalendarEvent> getEvents(DateTime start, DateTime end) {
    if (_listToShow == null) {
      _listToShow = UserDatabaseData.instance.games.values.toList();
    }
    if (_listToShow == null) {
      return [];
    }
    List<CalendarEvent> events = new List<CalendarEvent>();
    int pos = 0;
    _listToShow.forEach((Game g) => events.add(new CalendarEvent(
        instant: g.tzTime, instantEnd: g.tzEndTime, index: pos++)));
    return events;
  }
...

Example of the calendar widget in action:

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

Comments
  • How to limit start month and end month?

    How to limit start month and end month?

    How can I limit the months, not to became an infinite scroll? For example, I want to allow the user to access just 12 months before and after a given date. Thanks!

    opened by arvanus 4
  • Add new options (limit sliver list scrolling with the start and end months, weekBeginsWithDay, headerExpandIconColor, tapToCloseHeader), improvements and fix some issues

    Add new options (limit sliver list scrolling with the start and end months, weekBeginsWithDay, headerExpandIconColor, tapToCloseHeader), improvements and fix some issues

    Hello,

    thanks for your great Flutter package! I would like to propose you these new options: 1/ beginningRangeDate, endingRangeDate : limit the start and end months ( and the scrolling range of SliverScrollViewCalendar, https://github.com/pinkfish/flutter_calendar/issues/9 ) 2/ weekBeginsWithDay: to specify the day to start with the month calendar 3/ headerExpandIconColor: to set the color for the expand icon 4/ tapToCloseHeader (default to true): to enable or not closing the calendar on tap on the sliver list 5/ Image banners for the calendar header and the month headers are now optional (not required anymore)

    I also added some improvements such as:

    • localizing dates displayed on the left side,
    • improving some typos,
    • adding localization in the example main.dart file,
    • fix some warnings reported by 'flutter analyze'. (but there are still some others related to type casting -> will fix later...)
    • fix https://github.com/pinkfish/flutter_calendar/issues/10 (and possibly https://github.com/pinkfish/flutter_calendar/issues/8 )

    @pinkfish I let you review the code for merging PR

    opened by Eimji 3
  • Example App - Tapping on header doesn't open calendar

    Example App - Tapping on header doesn't open calendar

    Hi. I have cloned the repo and then ran "flutter run" on the example app.

    When I tap on "January 2019" nothing happens and I get an error in console:

    I/flutter (19922): Another exception was thrown: 'package:sliver_calendar/src/calendarheader.dart': error: file:///Users/user/.pub-cache/hosted/pub.dartlang.org/sliver_calendar-0.1.0/lib/src/calendarheader.dart:136:40: Error: The argument type 'Null Function(Null)' can't be assigned to the parameter type 'dynamic Function(void)'.

    What could be wrong?

    opened by robert-stevens 0
  • Calendar header handling animation controller incorrectly

    Calendar header handling animation controller incorrectly

    Hello,

    It seems that _CalendarHeaderState causes the following exception: flutter error: This widget has been unmounted, so the State no longer has a context (and should be considered defunct)

    The fix: 1: Move initialization of _controller to initState(): _controller=AnimationController(duration: _kExpand, vsync: this);

    2: Move everything in consctructor to initState() (after setting the _controller): _monthIndex = monthIndexFromTime(clock.now()); _easeInAnimation = CurvedAnimation(parent: _controller, curve: Curves.easeIn); _iconTurns = Tween(begin: 0.0, end: 0.5).animate(_easeInAnimation);

    HTH :)

    opened by UnicornaasTech 2
  • RenderFlex overflowed when padding

    RenderFlex overflowed when padding

    Hi.

    The Calendar displays without any problem on a full-device-width UI.

    But if I wrap the CalendarWidget with Padding, I get this overflow error RenderFlex overflowed

    Using this code

    Padding(
      padding: const EdgeInsets.all(10),
      child: CalendarWidget( ... )
    ),
    

    Does anyone know how can I fix this right overflow?? Thanks!

    opened by encubos 0
  • Exception CalendarWidgetState.dispose - When Flutter unmount and dispose CalendarWidget

    Exception CalendarWidgetState.dispose - When Flutter unmount and dispose CalendarWidget

    Hi.

    Can I use multiple Calendars in one screen ?? I have 2 or 3 tabs, and I am trying to put one Calendar inside each tab.

    I am getting this error in the debug console.

    ═══ Exception caught by widgets library ══════ The following assertion was thrown while finalizing the widget tree: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 1217 pos 12: '_debugLifecycleState == _StateLifecycle.ready': is not true.

    With this detail

    When the exception was thrown, this was the stack #2 State.dispose package:flutter/…/widgets/framework.dart:1217 #3 CalendarWidgetState.dispose package:sliver_calendar/src/calendar.dart:158 #4 StatefulElement.unmount package:flutter/…/widgets/framework.dart:4435 #5 _InactiveElements._unmount package:flutter/…/widgets/framework.dart:1748 #6 _InactiveElements._unmount. package:flutter/…/widgets/framework.dart:1746 ... ════════════════════════════

    Maybe is something wrong in my code, but I cant make it work properly.

    I am using the calendar inside TabBarView. Each TabBarView has a CalendarWidget... so I have multiple of them in my widget tree!

    The error appears in the debug console when I scroll to the second Tab.

    Any idea? Thanks in advance.

    opened by encubos 1
Releases(0.4.1)
Owner
null
Flutter calendar app. register schedule and manage in calendar ui.

flutter calendar app. register schedule and manage in calendar ui. save schedule data in firestore. and create widget and read schedule from firestore in widget.

akiho 11 Oct 30, 2022
Highly customizable, feature-packed calendar works like google calendar but with more features.

Beca [In Progress] Beca is a Calendar that you could manage your daily tasks and schedule meetings with your friends just like google calendar Concept

Mohammad Javad Hossieni 19 Nov 15, 2022
Calendar widget for flutter

Calendar Shows a scrolling calendar list of events. This is still relatively basic, it always assumes that the getEvents returns the entire list of ca

null 223 Dec 19, 2022
Highly customizable, feature-packed calendar widget for Flutter

Table Calendar Highly customizable, feature-packed Flutter Calendar with gestures, animations and multiple formats. Table Calendar with custom styles

Aleksander Woźniak 1.5k Jan 7, 2023
Calendar widget library for Flutter apps.

Calendarro Calendar widget library for Flutter apps. Offers multiple ways to customize the widget. Getting Started Installation Add dependency to your

Adam Styrc 97 Nov 30, 2022
A calendar widget for Flutter.

flutter_calendar A calendar widget for Flutter Apps. Borrowed DateTime utility functions from the Tzolkin Calendar web element. Usage Add to your pubs

AppTree Software, Inc 336 Sep 6, 2022
A calendar widget to easily scroll through the years 🗓

Flutter Scrolling Calendar A customizable calendar widget to easily scroll through the years. Features Choose range of years and the initial year to s

Menno Renkens 113 Nov 19, 2022
A Flutter package for using Jalali (Shamsi, Solar, Persian or Jalaali) calendar. You can convert, format and manipulate Jalali and Gregorian (Miladi) dates.

A Flutter package for using Jalali (Shamsi, Solar, Persian or Jalaali) calendar. You can convert, format and manipulate Jalali and Gregorian (Miladi) dates.

Amirreza Madani 63 Dec 21, 2022
Flutter Date Picker Library that provides a calendar as a horizontal timeline.

DatePickerTimeline Flutter Date Picker Library that provides a calendar as a horizontal timeline. How To Use Import the following package in your dart

LiLi 0 Oct 25, 2021
Easy to use and beautiful calendar strip component for Flutter.

Flutter Calendar Strip Easy to use and beautiful calendar strip component for Flutter. Awesome celender widget If this project has helped you out, ple

Siddharth V 176 Dec 14, 2022
Flutter Date Picker Library that provides a calendar as a horizontal timeline

Flutter Date Picker Library that provides a calendar as a horizontal timeline.

Vivek Kaushik 214 Jan 7, 2023
Flutter Inline Calendar

inline_calendar An inline calendar flutter package inspired by outlook app. It also supports Jalali/Shamsi calendar. Uses theme and locale of context

omid habibi 3 Oct 21, 2022
Flutter calendar week UI package

Flutter calendar week Flutter calendar week UI package IOS | Android: import 'package:flutter_calendar_week/flutter_calendar_week.dart'; CalendarWeek(

null 67 Dec 12, 2022
A seasonal foods calendar app written in Dart using Flutter.

This project is not actively maintained anymore. However, everybody who wants to do so is more than welcome to work on this project! Thank you for you

Andreas Boltres 63 Nov 19, 2022
Collection of customisable calendar related widgets for Flutter.

calendar_views Collection of customisable calendar related widgets for Flutter. Day View Day View Documentation Set of widgets for displaying a day vi

Zen Lednik 99 Sep 8, 2022
CalendarDatePicker2 - A lightweight and customizable calendar picker based on Flutter CalendarDatePicker

A lightweight and customizable calendar picker based on Flutter CalendarDatePicker, with support for single date picker, range picker and multi picker.

Neo Liu 27 Dec 22, 2022
Fluboard - Calendar wall-board-display built with Flutter and ❤️

Fluboard Calendar wall-board-display built with Flutter and ❤️ Goals Build calendar board (DAKBoard alternative) which easy to install and easy to cus

iTeqno 10 Dec 27, 2022
A Heatmap Calendar based on Github's contributions chart

Flutter Heat Map Calendar A Heat Map Calendar based on Github's contributions chart which can be used to visualize values over time Installing 1. Depe

Pedro H. F. Feitosa 49 Dec 6, 2022
A Flutter package for adding a DateRange widget into a form. A date picker UX is provided by showDateRangePicker.

A Flutter package for adding a DateRange widget into a form. A date picker UX is provided by showDateRangePicker.

JMA Consulting 9 Mar 12, 2022