in

Calendar widget for flutter that is swipeable horizontally

Calendar widget for flutter that is swipeable horizontally. This widget can help you build your own calendar widget highly customizable.

Rectangular style
calendar1
Circular style
calendar2
No border
calendar3
Marked Dates
calendar4

Getting Started

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

Props

propstypesdefaultValues
weekDays[‘Sun’, ‘Mon’, ‘Tue’, ‘Wed’, ‘Thur’, ‘Fri’, ‘Sat’]
viewPortFractiondouble1.0
prevDaysTextStyleTextStyle
daysTextStyleTextStyle
nextDaysTextStyleTextStyle
prevMonthDayBorderColorColorColors.transparent
thisMonthDayBorderColorColorColors.transparent
nextMonthDayBorderColorColorColors.transparent
dayPaddingdouble2.0
heightdoubledouble.infinity
widthdoubledouble.infinity
todayTextStyleTextStylefontSize: 14.0, color: Colors.white
dayButtonColorColorColors.red
todayBorderColorColorColors.red
todayButtonColorColorsColors.red
selectedDateTimeDateTime
selectedDayTextStyleTextStylefontSize: 14.0, color: Colors.white
selectedDayBorderColorColorColors.green
selectedDayButtonColorColorColors.green
daysHaveCircularBorderbool
onDayPressedFunc
weekdayTextStyleTextStylefontSize: 14.0, color: Colors.deepOrange
iconColorColorColors.blueAccent
headerTextTextText('${DateFormat.yMMM().format(this._dates[1])}')
weekendTextStyleTextStylefontSize: 14.0, color: Colors.pinkAccent
markedDatesList<DateTime[]
markedDateColorColorColors.blueAccent
markedDateWidgetColorPositioned(child: Container(color: Colors.blueAccent, height: 4.0, width: 4.0), bottom: 4.0, left: 18.0);
headerMarginEdgetInsetsconst EdgeInsets.symmetric(vertical: 16.0)
childAspectRatiodouble1.0
weekDayMarginEdgeInsetsconst EdgeInsets.only(bottom: 4.0)

Install

Add flutter_calendar_carousel as a dependency in pubspec.yaml
For help on adding as a dependency, view the documentation.

Usage

import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart' show CalendarCarousel;
Widget widget() {
  return Container(
    margin: EdgeInsets.symmetric(horizontal: 16.0),
    child: CalendarCarousel(
      current: DateTime.now(),
      onDayPressed: (DateTime date) {
        this.setState(() => _currentDate = date);
      },
      thisMonthDayBorderColor: Colors.grey,
      height: 420.0,
      selectedDateTime: _currentDate,
      daysHaveCircularBorder: false, /// null for not rendering any border, true for circular border, false for rectangular border
//          weekendStyle: TextStyle(
//            color: Colors.red,
//          ),
//          weekDays: null, /// for pass null when you do not want to render weekDays
//          headerText: Container( /// Example for rendering custom header
//            child: Text('Custom Header'),
//          ),
    ),
  );
}

TODO

  • [x] Render weekdays.
  • [x] Customizable headerWidget.
  • [x] Set weekdays visibility.
  • [x] Customizable textStyles for days in weekend.
  • [x] Marked Dates.
  • [ ] Multiple days selections.
  • [ ] Widget test.

GitHub

https://github.com/dooboolab/flutter_calendar_carousel

Written by James

Shows a scrolling calendar list of events

Flutter cupertino style date picker