flutter_calendar_carousel 1.2.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 94

flutter_calendar_carousel

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

pub version

Rectangular style

Circular style

No border

Marked Dates

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
headerTextStyleTextStylefontSize: 20.0, color: Colors.blue
headerTextTextText('${DateFormat.yMMM().format(this._dates[1])}')
weekendTextStyleTextStylefontSize: 14.0, color: Colors.pinkAccent
~markedDatesList<DateTime>[]
markedDatesMapMap<DateTime, int>null
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)
weekFormatboolfalse
weekendsList<WeekDay>[WeekDay.Saturday, WeekDay.Sunday]

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.
  • [x] Multiple Marked Dates.
  • [x] Customizable weekend days.
  • [x] Week Calendar.
  • [x] Carousel Week Calendar.
  • [ ] Multiple days selections.
  • [ ] Widget test.

Help Maintenance

I've been maintaining quite many repos these days and burning out slowly. If you could help me cheer up, buying me a cup of coffee will make my life really happy and get much energy out of it. <br/><a href="https://www.buymeacoffee.com/dooboolab" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

[1.2.0]

  • Support carousel week calendar.

[1.1.11]

  • Ability to customize weekend days #13.

[1.1.10]

  • Support weekFormat but without carousel.

[1.1.9]

  • Updated readme.

[1.1.8]

  • Render multiple marked dates.
  • markedDates is deprecated. Use markedDatesMap instead.

[1.1.3]

  • Mark dates with non-zero times.

[1.1.2]

  • Implemented a way to change the header text style.

[1.1.1]

  • Expose new variables.
    • headerMargin, childAspectRatio, weekDayMargin

[1.1.0]

  • Give proper text color in weekend when it is today.
  • Compare month and year for marking today's date. Resolve #3.

[1.0.3]

  • Fixed pub broken image.

[1.0.2]

  • Use Position widget to mark the dates.

[1.0.1]

  • Show markedDates.

[0.2.0]

  • Customizable headerWidget.
  • Setting weekdays visibility
  • Customizable weekend color.

[0.1.3]

  • Rename the top-level "docs" directory to "doc".

[0.1.1]

  • Added readme.

[0.1.0]

  • First release

example/README.md

flutter_calendar_carousel

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
      markedDatesMap: _markedDateMap,
//          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'),
//          ),
    ),
  );
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_calendar_carousel: ^1.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart';
  
Version Uploaded Documentation Archive
1.2.0 Nov 16, 2018 Go to the documentation of flutter_calendar_carousel 1.2.0 Download flutter_calendar_carousel 1.2.0 archive
1.1.10 Nov 13, 2018 Go to the documentation of flutter_calendar_carousel 1.1.10 Download flutter_calendar_carousel 1.1.10 archive
1.1.9 Nov 11, 2018 Go to the documentation of flutter_calendar_carousel 1.1.9 Download flutter_calendar_carousel 1.1.9 archive
1.1.8 Nov 11, 2018 Go to the documentation of flutter_calendar_carousel 1.1.8 Download flutter_calendar_carousel 1.1.8 archive
1.1.7 Nov 8, 2018 Go to the documentation of flutter_calendar_carousel 1.1.7 Download flutter_calendar_carousel 1.1.7 archive
1.1.6 Oct 26, 2018 Go to the documentation of flutter_calendar_carousel 1.1.6 Download flutter_calendar_carousel 1.1.6 archive
1.1.5 Oct 25, 2018 Go to the documentation of flutter_calendar_carousel 1.1.5 Download flutter_calendar_carousel 1.1.5 archive
1.1.4 Oct 25, 2018 Go to the documentation of flutter_calendar_carousel 1.1.4 Download flutter_calendar_carousel 1.1.4 archive
1.1.3 Oct 7, 2018 Go to the documentation of flutter_calendar_carousel 1.1.3 Download flutter_calendar_carousel 1.1.3 archive
1.1.2 Sep 29, 2018 Go to the documentation of flutter_calendar_carousel 1.1.2 Download flutter_calendar_carousel 1.1.2 archive

All 24 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
89
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
94
Learn more about scoring.

We analyzed this package on Nov 16, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/flutter_calendar_carousel.dart. (-1 points)

Analysis of lib/flutter_calendar_carousel.dart reported 2 hints:

line 115 col 22: 'markedDates' is deprecated and shouldn't be used.

line 117 col 22: 'markedDateColor' is deprecated and shouldn't be used.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
date_utils ^0.1.0 0.1.0+2
flutter 0.0.0
intl ^0.15.7 0.15.7
Transitive dependencies
collection 1.14.11
meta 1.1.6
path 1.6.2
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test