Giter Club home page Giter Club logo

flutter_calendar_carousel's Introduction

flutter_calendar_carousel

Pub Version Flutter CI Coverage Status License

Calendar widget for flutter that is swipeable horizontally. This widget can help you build your own calendar widget highly customizable. Now you can even add your icon for each event.

Notice

This widget is compatible with flutter V3 from version 2.4.+.

New Feature

[2.0.3]

  • Multiple days selection using addRange method #285

  • Check out great feature customDayBuilder work done by maxgmer 🎉.

Rectangular style

image

Circular style

image

No border

image

Marked Dates

image

Custom Icon Events

image

Getting Started

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

Props

props types defaultValues
viewPortFraction double 1.0
prevDaysTextStyle TextStyle
daysTextStyle TextStyle
nextDaysTextStyle TextStyle
prevMonthDayBorderColor Color Colors.transparent
thisMonthDayBorderColor Color Colors.transparent
nextMonthDayBorderColor Color Colors.transparent
dayPadding double 2.0
height double double.infinity
width double double.infinity
todayTextStyle TextStyle fontSize: 14.0, color: Colors.white
dayButtonColor Color Colors.red
todayBorderColor Color Colors.red
todayButtonColor Colors Colors.red
selectedDateTime DateTime
selectedDayTextStyle TextStyle fontSize: 14.0, color: Colors.white
selectedDayBorderColor Color Colors.green
selectedDayButtonColor Color Colors.green
daysHaveCircularBorder bool
onDayPressed Func
weekdayTextStyle TextStyle fontSize: 14.0, color: Colors.deepOrange
iconColor Color Colors.blueAccent
headerTextStyle TextStyle fontSize: 20.0, color: Colors.blue
headerText Text Text('${DateFormat.yMMM().format(this._dates[1])}')
weekendTextStyle TextStyle fontSize: 14.0, color: Colors.pinkAccent
markedDatesMap Events null
markedDateWidget Widget Positioned(child: Container(color: Colors.blueAccent, height: 4.0, width: 4.0), bottom: 4.0, left: 18.0);
markedDateShowIcon bool false
markedDateIconBorderColor Color
markedDateIconMaxShown int 2
markedDateIconMargin double 5.0
markedDateIconBuilder MarkedDateIconBuilder<T>
markedDateIconOffset double 5.0
markedDateCustomShapeBorder ShapeBorder null
markedDateCustomTextStyle TextStyle null
markedDateMoreCustomDecoration Decoration
markedDateMoreCustomTextStyle TextStyle
headerMargin EdgetInsets const EdgeInsets.symmetric(vertical: 16.0)
headerTitleTouchable bool false
onHeaderTitlePressed Function () => _selectDateFromPicker()
showHeader bool
showHeaderButton bool
childAspectRatio double 1.0
weekDayMargin EdgeInsets const EdgeInsets.only(bottom: 4.0)
weekFormat bool false
locale String en
firstDayOfWeek int null
onCalendarChanged Function(DateTime)
minSelectedDate DateTime
maxSelectedDate DateTime
inactiveDaysTextStyle TextStyle
inactiveWeekendTextStyle TextStyle
weekDayFormat WeekdayFormat short
staticSixWeekFormat bool false
showOnlyCurrentMonthDate bool false
dayCrossAxisAlignment CrossAxisAlignment CrossAxisAlignment.center
dayMainAxisAlignment MainAxisAlignment CrossAlignment.center
showIconBehindDayText bool false
pageScrollPhysics ScrollPhysics ScrollPhysics

With CalendarCarousel<YourEventClass> and EventList<YourEventClass> you can specifiy a custom Event class.

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<Event>(
      onDayPressed: (DateTime date, List<Event> events) {
        this.setState(() => _currentDate = date);
      },
      weekendTextStyle: TextStyle(
        color: Colors.red,
      ),
      thisMonthDayBorderColor: Colors.grey,
//      weekDays: null, /// for pass null when you do not want to render weekDays
//      headerText: Container( /// Example for rendering custom header
//        child: Text('Custom Header'),
//      ),
      customDayBuilder: (   /// you can provide your own build function to make custom day containers
        bool isSelectable,
        int index,
        bool isSelectedDay,
        bool isToday,
        bool isPrevMonthDay,
        TextStyle textStyle,
        bool isNextMonthDay,
        bool isThisMonthDay,
        DateTime day,
      ) {
          /// If you return null, [CalendarCarousel] will build container for current [day] with default function.
          /// This way you can build custom containers for specific days only, leaving rest as default.

          // Example: every 15th of month, we have a flight, we can place an icon in the container like that:
          if (day.day == 15) {
            return Center(
              child: Icon(Icons.local_airport),
            );
          } else {
            return null;
          }
      },
      weekFormat: false,
      markedDatesMap: _markedDateMap,
      height: 420.0,
      selectedDateTime: _currentDate,
      daysHaveCircularBorder: false, /// null for not rendering any border, true for circular border, false for rectangular border
    ),
  );
}

TODO

  • Render weekdays.
  • Customizable headerWidget.
  • Set weekdays visibility.
  • Customizable textStyles for days in weekend.
  • Marked Dates.
  • Multiple Marked Dates.
  • Customizable weekend days.
  • Week Calendar.
  • 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.
Buy Me A Coffee Paypal

flutter_calendar_carousel's People

Contributors

abhishek01039 avatar akuma06 avatar cristoferfb2 avatar edgartrem avatar edtheguy00 avatar hkirk avatar hyochan avatar icemanbsi avatar ichordedionysos avatar kkmurerwa avatar kliyer-ai avatar letsar avatar limatationz avatar lucasvienna avatar mashnoon33 avatar matthewrice345 avatar maxgmer avatar mehndirattapiyush avatar miolin avatar renovate[bot] avatar rian-hotate avatar rodolfosilva avatar sagarzala123 avatar solidaycl avatar takumade avatar tetsufe avatar thayesx avatar the-redhat avatar tomtruyen avatar valitutto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_calendar_carousel's Issues

weekDays isn't exposed

Version of flutter_calendar_carousel

1.3.3

Expected behavior

Ability to change weekday texts

Actual behavior

The property weekDays isn't exposed by the class. I also check in the code.

You can also see in the documentation that the weekDays property is used. It's misleading I think.

Thanks for your great plugin. I appreciate your opensource work.

Custom Icons not shown in example

Version of flutter_calendar_carousel

1.3.12

Expected behavior

I am running the exact example from the repo and I expected to see custom icons.

Actual behavior

Instead, I can see only events number on dates where events are placed.

flutter doctor result (run flutter doctor in terminal)

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.590], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.3)
[√] Connected device (1 available)
• No issues found!

Steps to reproduce the behavior

Just clone the repo, change line 147 to weekFormat: false, and run it.

`selectedDayTextStyle` property is not being respects

Version of flutter_calendar_carousel

1.3.10

Expected behavior

  • Expected behavior is selectedDayTextStyle should be used when weekFormat is false i.e. in builder function. When weekFormat is true, i.e. in weekBuilder, it is being respected and used but not in builder function

Actual behavior

  • selectedDayTextStyle is not being used rather daysTextStyle is used.

flutter doctor result (run flutter doctor in terminal)

 ▲ ~ flutter doctor                                                                          8s 
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.0.0, on Linux, locale en_IN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] Android Studio (version 3.2)
[✓] Connected device (1 available)

• No issues found!

Steps to reproduce the behavior

CalendarCarousel<Event>(
  customGridViewPhysics: NeverScrollableScrollPhysics(),
  onDayPressed: (DateTime date, List<Event> evs) {
    this.setState(() => _currentDate = date);
  },
  onCalendarChanged: (date) {
    print(
        "Fetching events around ${date.month}/${date.year}");
    calBloc.fetchEvents(
        DateTime(date.year, date.month, 1), _eventIcon);
  },
  weekendTextStyle: TextStyle(
    color: Colors.red[800],
  ),

  headerTextStyle: theme.textTheme.title,

  daysTextStyle: theme.textTheme.subhead,

  weekFormat: false,
  markedDatesMap: el.EventList(events: snapshot.data ?? {}),
  markedDateShowIcon: true,
  markedDateIconMaxShown: 0,

  markedDateMoreShowTotal: true,
  markedDateMoreCustomDecoration: BoxDecoration(
    color: theme.accentColor.withOpacity(1.0),
    shape: BoxShape.circle,
  ),

  todayButtonColor: theme.accentColor.withOpacity(0.6),

  selectedDayButtonColor: theme.accentColor,
  selectedDayTextStyle: theme.accentTextTheme.subhead,

  height: 420.0,
  selectedDateTime: _currentDate,

  // null for not rendering any border, true for circular border, false for rectangular border
  daysHaveCircularBorder: null,
  staticSixWeekFormat: true,

  iconColor: theme.accentColor,
  weekdayTextStyle: TextStyle(
      // color: theme.accentColor.withOpacity(0.9),
      color: Colors.grey,
      fontWeight: FontWeight.bold),
)

Fix

▲ pub.dartlang.org/flutter_calendar_carousel-1.3.10/lib diff flutter_calendar_carousel-new.dart flutter_calendar_carousel.dart 
494,501c494,499
<                                             : isSelectedDay
<                                                 ? widget.selectedDayTextStyle
<                                                 : isToday
<                                                     ? widget.todayTextStyle
<                                                     : isSelectable
<                                                         ? widget.daysTextStyle
<                                                         : widget
<                                                             .inactiveDaysTextStyle,
---
>                                             : isToday
>                                                 ? widget.todayTextStyle
>                                                 : isSelectable
>                                                     ? widget.daysTextStyle
>                                                     : widget
>                                                         .inactiveDaysTextStyle,

error: The argument type '(DateTime) → Null' can't be assigned to the parameter type '(DateTime, List<dynamic>) → dynamic'. (argument_type_not_assignable at [app])

Version: flutter_calendar_carousel: ^1.2.3
Flutter Flutter 0.9.7-pre.890 • channel master • https://github.com/flutter/flutter.git
Dart VM version: 2.0.0 (Fri Aug 3 10:53:23 2018 +0200) on "macos_x64"

Cannot compile, error is received: can't be assigned to the parameter type '(DateTime, List) → dynamic'. (argument_type_not_assignable at [portal_app] lib/ui/pages/vacations/requests/request_vacations.dart:95)

[✓] Flutter (Channel master, v0.9.7-pre.890, on Mac OS X 10.14 18A391, locale es-CO)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.1)
[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
✗ Verify that all connected devices have been paired with this computer in Xcode.
If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
To update with Brew, run:
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
[✓] Android Studio (version 3.1)
[✓] IntelliJ IDEA Community Edition (version 2018.2.5)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

Create a function that returns a Widget:

Widget calendar(){
    dynamic WeekDay = { "Sunday": "Sunday", "Saturday": "Saturday"};
    return CalendarCarousel(
      onDayPressed: (DateTime date) {
        this.setState((){
          _currentDate = date;
        });
        String name = _currentDate.toUtc().toString();
        this.addItemToList(name);
        setState((){});
      },

      weekendTextStyle: TextStyle(
        color: Colors.lightGreen,
      ),
      thisMonthDayBorderColor: Colors.grey,
      weekFormat: false,
      markedDatesMap: _markedDateMap,
      height: 300.0,
      childAspectRatio: 1.8,
      selectedDateTime: _currentDate,
      daysHaveCircularBorder: true, /// null for not rendering any border, true for circular border, false for rectangular border
    );
  }

Property weekendTextStyle not working

When I try to modify the color in weekendTextStyle, the calendar still presents the default color defined in defaultWeekendTextStyle (pinkAccent).

The piece of code I'm modifying:
weekendTextStyle: TextStyle(color: Colors.red)

Version of flutter_calendar_carousel
^1.2.3

Importation

Version of flutter_calendar_carousel

The flutter_calendar_carosel library is not importing into my project, says there is no such import. I've tried changing the versions but the same error has continued. Can someone help me?

Can't use at all

Version of flutter_calendar_carousel

Expected behavior

Actual behavior

flutter doctor result (run flutter doctor in terminal)

Steps to reproduce the behavior

Clean Code

This is not an issue but more of a proposition. I've used this library on two of my projects, great library. However, every time I look at the source code it's honestly a bit confusing.

Main Issue

There is more than 1,000 lines of code in one file, code is a bit messy, has too many nested ternary operators, makes it difficult to read and maintain.

Proposition

I propose to refactor and move out some code from the flutter_calendar_carousel.dart file into more reusable and maintainable widgets. For example,

  widget.showHeader
              ? Container(
                  margin: widget.headerMargin,
                  child: DefaultTextStyle( ........
                             .........................
                             .........................
                             .........................
                             .........................

We could move all this code into a separate widget class and just use

  widget.showHeader ? Header() : NotHeader()

The same can be done to various widgets used.

widget.weekFormat ? Calendar.weekView() : Calendar.monthView()

The project structure should look something like this.

    --flutter_calendar_carousel.dart
    --src/
       -header.dart
       -calendar.dart
       -day_widget.dart
       -default_styles.dart
        etc....

Benefits

  1. Easier to read
  2. Easier to debug
  3. Easier to maintain
  4. Testable widgets

Suggestion: date widgets can differ per date. Following logic change can help it.

  final Map<DateTime,Widget> markedDates;

  Widget _renderMarked(DateTime now) {
    if (widget.markedDates != null && widget.markedDates.length > 0) {
      for (DateTime key in widget.markedDates.keys) {
        if (key.year == now.year && key.month == now.month && key.day == now.day) {
          return widget.markedDates[key] == null
              ? widget.markedDateWidget
              : widget.markedDates[key];
        }
      }
    }
    return Container();
  }
}

image

See different date widgets for date 3 and 4.

Btw, awesome work guys!

error: Not a constant expression: unexpected kernel tag InvalidExpression (19)

Version of flutter_calendar_carousel

flutter_calendar_carousel: ^1.3.3

body:
import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart' show CalendarCarousel;
Container(
child: CalendarCarousel()
)

I/flutter (24871): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (24871): The following _CompileTimeError was thrown building MainWidget(dirty, state:
I/flutter (24871): _MainWidgetState#8c468):
I/flutter (24871): 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart': error: Not a constant
I/flutter (24871): expression: unexpected kernel tag InvalidExpression (19)
I/flutter (24871):
I/flutter (24871): When the exception was thrown, this was the stack:
I/flutter (24871): #0 _MainWidgetState.build (file:///D:/android/projects/polnayazapis/lib/main.dart:36:18)
I/flutter (24871): #1 StatefulElement.build (package:flutter/src/widgets/framework.dart:3766:27)
I/flutter (24871): #2 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3678:15)
I/flutter (24871): #3 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
I/flutter (24871): #4 StatefulElement.update (package:flutter/src/widgets/framework.dart:3835:5)
I/flutter (24871): #5 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
I/flutter (24871): #6 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
I/flutter (24871): #7 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
I/flutter (24871): #8 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
I/flutter (24871): #9 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.9.4, on Microsoft Windows [Version 10.0.17134.472], locale ru-RU)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.2)
[√] Connected devices (1 available)

Cant format weekDays?

The new version just limits the week days to SHORTWEEKDAYS,"Mon", "Tues, Wed, ...", doesnt allow specifying other version like "M, T, W, T, F, S, S" for example.

Calendar should have default height to wrap content

Version of flutter_calendar_carousel

Version 1.3.7

Expected behavior

CalendarCarousel widget should have wrap_content height if height attribute is not manually set

Actual behavior

when height is not set, CalendarCarousel takes full screen height

flutter doctor result (run flutter doctor in terminal)

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.0.0, on Mac OS X 10.13.6 17G4015, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] Connected device (2 available)

• No issues found!

Exception when height and width are not provided in constructor

Version of flutter_calendar_carousel

v1.2.3

Expected behavior

Showing the calendar or raising an error

Actual behavior

Showing nothing and raising a ConstaintBox exception on Flutter

flutter doctor result (run flutter doctor in terminal)

I/flutter (18178): startWeekDay: 5
I/flutter (18178): endWeekDay: 1
I/flutter (18178): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (18178): The following assertion was thrown during performLayout():
I/flutter (18178): BoxConstraints forces an infinite height.
I/flutter (18178): These invalid constraints were provided to RenderFlex's layout() function by the following function,
I/flutter (18178): which probably computed the invalid constraints in question:
I/flutter (18178):   RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:258:13)
I/flutter (18178): The offending constraints were:
I/flutter (18178):   BoxConstraints(w=360.0, h=Infinity)
I/flutter (18178):
I/flutter (18178): When the exception was thrown, this was the stack:
I/flutter (18178): #0      BoxConstraints.debugAssertIsValid.<anonymous closure>.throwError (package:flutter/src/rendering/box.dart:504:9)
I/flutter (18178): #1      BoxConstraints.debugAssertIsValid.<anonymous closure> (package:flutter/src/rendering/box.dart:547:21)
I/flutter (18178): #2      BoxConstraints.debugAssertIsValid (package:flutter/src/rendering/box.dart:551:6)
I/flutter (18178): #3      RenderObject.layout (package:flutter/src/rendering/object.dart:1549:24)
I/flutter (18178): #4      RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:258:13)
I/flutter (18178): #5      RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #6      RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:738:15)
I/flutter (18178): #7      RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #8      MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:142:11)
I/flutter (18178): #9      _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:339:7)
I/flutter (18178): #10     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:212:7)
I/flutter (18178): #11     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:356:14)
I/flutter (18178): #12     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #13     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #14     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #15     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #16     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1188:11)
I/flutter (18178): #17     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #18     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #19     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #20     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #21     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #22     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #23     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #24     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #25     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #26     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #27     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #28     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #29     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #30     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #31     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #32     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #33     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:2881:13)
I/flutter (18178): #34     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #35     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:510:15)
I/flutter (18178): #36     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #37     __RenderTheatre&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #38     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #39     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #40     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #41     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #42     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #43     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #44     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #45     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #46     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #47     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (18178): #48     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (18178): #49     RenderView.performLayout (package:flutter/src/rendering/view.dart:147:13)
I/flutter (18178): #50     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1509:7)
I/flutter (18178): #51     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:768:18)
I/flutter (18178): #52     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:281:19)
I/flutter (18178): #53     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:677:13)
I/flutter (18178): #54     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
I/flutter (18178): #55     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter (18178): #56     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter (18178): #57     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:751:7)
I/flutter (18178): #59     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
I/flutter (18178): #60     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
I/flutter (18178): #61     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
I/flutter (18178): (elided one frame from package dart:async)
I/flutter (18178):
I/flutter (18178): The following RenderObject was being processed when the exception was fired:
I/flutter (18178):   RenderConstrainedBox#1796f relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):   creator: ConstrainedBox ← Container ← CalendarCarousel ← Column ← Container ← CalendarFragment ←
I/flutter (18178):   MediaQuery ← LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ← AnimatedBuilder ←
I/flutter (18178):   DefaultTextStyle ← AnimatedDefaultTextStyle ← ⋯
I/flutter (18178):   parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size)
I/flutter (18178):   constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)
I/flutter (18178):   size: MISSING
I/flutter (18178):   additionalConstraints: BoxConstraints(biggest)
I/flutter (18178): This RenderObject had the following descendants (showing up to depth 5):
I/flutter (18178):   RenderFlex#5eb51 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):     RenderPadding#72036 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):       RenderFlex#0d566 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):         RenderSemanticsGestureHandler#c4f53 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):           RenderPointerListener#b405f NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):         RenderSemanticsAnnotations#7293f NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):           _RenderInputPadding#533da NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):         RenderSemanticsGestureHandler#eaa82 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):           RenderPointerListener#4732f NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):     RenderFlex#c6ce0 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):       RenderPadding#315bb NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):         RenderPositionedBox#8ede9 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):           RenderParagraph#2463b NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):       RenderPadding#dfbaf NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):         RenderPositionedBox#0f036 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):           RenderParagraph#a1f06 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):       RenderPadding#085ca NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):         RenderPositionedBox#32d2c NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):           RenderParagraph#82642 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):       RenderPadding#a686e NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):         RenderPositionedBox#8ea08 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):           RenderParagraph#3bb18 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):       RenderPadding#4888c NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):         RenderPositionedBox#b4e45 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):           RenderParagraph#bea7e NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):       RenderPadding#836bf NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):         RenderPositionedBox#f5c7a NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178):           RenderParagraph#ca352 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (18178): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter (18178): Another exception was thrown: RenderBox was not laid out: RenderConstrainedBox#1796f relayoutBoundary=up2 NEEDS-PAINT
I/flutter (18178): Another exception was thrown: RenderBox was not laid out: RenderFlex#bb5d7 relayoutBoundary=up1 NEEDS-PAINT
I/flutter (18178): Another exception was thrown: NoSuchMethodError: The method '<=' was called on null.

Steps to reproduce the behavior

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: [
          CalendarCarousel()
        ],
      ),
    );
  }

[Question] What's the usage of date member in Event class

Version of flutter_calendar_carousel

1.3.12

Expected behavior

As shown in the example, events are kept by EventList<Event> which essentially is map of DateTIme and list of all events on specified date. However, within Event class there is another DateTime field - date which basically duplicates date on the wrapper class - EventList. It seems to me redundant.

Actual behavior

Keep reference of date key within all Event elements for this key.

flutter doctor result (run flutter doctor in terminal)

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.590], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.3)
[√] Connected device (1 available)
• No issues found!

Steps to reproduce the behavior

na

Current day selected everymonth

Version of flutter_calendar_carousel

v1.0.3

Expected behavior

Selected current day only in the current month

Actual behavior

In every month the "current day" is marked

flutter doctor result (run flutter doctor in terminal)

Steps to reproduce the behavior

Just create a new calendar with default options and change current month to next or previous

Colors

Version of flutter_calendar_carousel

lasted

Issues

todayTextStyle, todayBorderColor, selectedDayBorderColor, selectedDayTextStyle
I need to change color and style but this params now working, nothing change.
Thank.

Map in EventList can only have one key using add method

Version of flutter_calendar_carousel: 1.3.2

Expected behavior: Can add multiple date items to the map e.g. in a loop

Actual behavior: Existing item is always replaced by latest so can't have a map with more than one item

flutter doctor result (run flutter doctor in terminal): Ticks all round - All fine

Steps to reproduce the behavior:

EventList dates = EventList();
dates.add('1 Jan 2018', Event(date: '1 Jan 2018'));
dates.add('2 Jan 2018', Event(date: '2 Jan 2018'));

dates only has 2 Jan entry.

headerTextStyle Broke?

Version of flutter_calendar_carousel

1.2.1, first noticed the issue on 1.2.0

expected behavior:

setting headerTextStyle should set the style of the header text

Actual behavior

headerTextStyle does nothing and the text follows the same style as the iconColor

flutter doctor result (run flutter doctor in terminal)

[✓] Flutter (Channel beta, v0.11.3, on Mac OS X 10.14.1 18B75, locale en-TH)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.4)
[✓] VS Code (version 1.29.0)
[✓] Connected device (1 available)

iconColor: Colors.red, headerTextStyle: TextStyle( color: Colors.white, fontSize: 20.0, ),

Also is there a way to remove the icons? or set them as optional? I was previously just setting their color to transparent, that's how I found this issue, because the header text disappeared after upgrading

screen shot 2561-11-19 at 21 22 19

Expose other parameters

Version of flutter_calendar_carousel

v1.1.0

Expected behavior

Expose variables to change, exactly like dayPadding
-HeaderMargin EdgeInsets.symmetric(vertical: 16.0), line 149
-childAspectRatio childAspectRatio: 1.0, line 243
-WeekDayBottonMarging margin: EdgeInsets.only(bottom: 4.0), line 429 (least important of the other 2 parameters)
Expected to reduce total used size for the calendar, to reduce it's used height
I'm trying to use other elements with the calendar, but now it's using almost +- 80% of the screen.
(if you have other idea, I'll be glad :) )

If it's OK, I can change it, and pull a path later...
Thanks!

Add DateTime option in custom markedDateWidget

The option to specify custom markedDateWidget is nice but would be great if you can pass which date it is because some people want different ui for certain dates.

Something in the form of

typedef Widget MarkedDateWidget(DateTime dateTime);

// And 

 List<Widget> _renderMarkedMap(DateTime now) {
    if (widget.markedDatesMap != null && widget.markedDatesMap.length > 0) {
      for (DateTime key in widget.markedDatesMap.keys) {
        if (key.year == now.year &&
            key.month == now.month &&
            key.day == now.day) {
          List<Widget> tmp = [];
          if (widget.markedDateWidget != null) { 
            tmp.add(widget.markedDateWidget(key));
          } else {
            for (int i = 0; i < widget.markedDatesMap[key]; i++) {
              tmp.add(widget.defaultMarkedDateWidget);
            }
            return tmp;
          }
        }
      }
      return [];
    }
  }

Version of flutter_calendar_carousel

^1.2.2

Choose Weekend days

Version of flutter_calendar_carousel

1.1.9

Expected behavior

able to choose which days of the week is weekend
for example: in my country only saturday is the weekend day but the plugin has both sat and sun as the weekend

Actual behavior

Both saturday and sunday are marked as weekend

Steps to reproduce the behavior

a option to change the current weekend days

Calendar prevents ListView form scrolling

Version of flutter_calendar_carousel

1.3.8

Actual behavior

The Calendar seems to listens to vertical scroll events, even though the calendar is horizontally scrollable and not vertical. The problem with this is, inside a ListView, it will prevent the ListView from scrolling, so I need to scroll outside the Calendar to scroll the ListView instead of the Calendar.

Slide automatically on selectedDateTime change

Hi!
There's a way to scroll automatically when you select a day in another month?

For example: User select new day by a button, setState to update CalendarCarousel, but if this new day is on different month, it doesn't slide.

setState(() {
          this._headerDateSelected = widget.agenda[index].day;
        });
CalendarCarousel(
          selectedDateTime: _headerDateSelected
)

Any ideia?

Calendar is sliding slow

Hi i'm having troubles with slide. When I touch de buttons, it correctly change, but when I want to slide the calendar's month, It is not smoothy. Sorry if I can not explain correctly myself. Any idea of that? I have been using the example code (I will paste my code anyway)

Version of flutter_calendar_carousel

^1.3.7

Expected behavior

Fluid slide

Actual behavior

Slow slide

flutter doctor result (run flutter doctor in terminal)

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v1.0.0, on Microsoft Windows [Versión 10.0.17134.523], locale es-ES)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
X Android license status unknown.
[√] Android Studio (version 3.1)
[√] VS Code, 64-bit edition (version 1.26.1)

Steps to reproduce the behavior

My code is here because I could not paste it correctly, sorry.
https://pastebin.com/5bjJp7dh

My phone is a Samsung Galaxy S6 with Android 7.0

Locale parameter is not working

Version of flutter_calendar_carousel

1.3.11

Expected behavior

Using CalendarCarousel(),

if locale parameter is "ja", I expect that a header and day labels show in Japanese.

Actual behavior

show in English.

flutter doctor result (run flutter doctor in terminal)

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v1.2.1, on Mac OS X 10.14.3 18D109, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[!] VS Code (version 1.31.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)

! Doctor found issues in 1 category.

Steps to reproduce the behavior

run below code in iPhone simulator.

lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart'
    show CalendarCarousel;
import 'package:flutter_calendar_carousel/classes/event.dart';
import 'package:flutter_calendar_carousel/classes/event_list.dart';
import 'package:intl/intl.dart' show DateFormat;

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'dooboolab flutter calendar',
      theme: new ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or press Run > Flutter Hot Reload in IntelliJ). Notice that the
        // counter didn't reset back to zero; the application is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Calendar Carousel Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  DateTime _currentDate = DateTime(2019, 1, 3);
  DateTime _currentDate2 = DateTime(2019, 1, 3);
  String _currentMonth = '';
//  List<DateTime> _markedDate = [DateTime(2018, 9, 20), DateTime(2018, 10, 11)];
  static Widget _eventIcon = new Container(
    decoration: new BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.all(Radius.circular(1000)),
        border: Border.all(color: Colors.blue, width: 2.0)),
    child: new Icon(
      Icons.person,
      color: Colors.amber,
    ),
  );

  EventList<Event> _markedDateMap = new EventList<Event>(
    events: {
      new DateTime(2018, 12, 10): [
        new Event(
          date: new DateTime(2018, 12, 10),
          title: 'Event 1',
          icon: _eventIcon,
        ),
        new Event(
          date: new DateTime(2018, 12, 10),
          title: 'Event 2',
          icon: _eventIcon,
        ),
        new Event(
          date: new DateTime(2018, 12, 10),
          title: 'Event 3',
          icon: _eventIcon,
        ),
      ],
    },
  );

  CalendarCarousel _calendarCarousel, _calendarCarouselNoHeader;

  @override
  void initState() {
    /// Add more events to _markedDateMap EventList
    _markedDateMap.add(
        new DateTime(2018, 12, 25),
        new Event(
          date: new DateTime(2018, 12, 25),
          title: 'Event 5',
          icon: _eventIcon,
        ));

    _markedDateMap.add(
        new DateTime(2018, 12, 10),
        new Event(
          date: new DateTime(2018, 12, 10),
          title: 'Event 4',
          icon: _eventIcon,
        ));

    _markedDateMap.addAll(new DateTime(2018, 12, 11), [
      new Event(
        date: new DateTime(2018, 12, 11),
        title: 'Event 1',
        icon: _eventIcon,
      ),
      new Event(
        date: new DateTime(2018, 12, 11),
        title: 'Event 2',
        icon: _eventIcon,
      ),
      new Event(
        date: new DateTime(2018, 12, 11),
        title: 'Event 3',
        icon: _eventIcon,
      ),
    ]);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    _calendarCarousel = CalendarCarousel<Event>(
      todayBorderColor: Colors.green,
      onDayPressed: (DateTime date, List<Event> events) {
        this.setState(() => _currentDate2 = date);
        events.forEach((event) => print(event.title));
      },
      weekendTextStyle: TextStyle(
        color: Colors.red,
      ),
      thisMonthDayBorderColor: Colors.grey,
      weekFormat: false,
      markedDatesMap: _markedDateMap,
      height: 420.0,
      selectedDateTime: _currentDate2,
      customGridViewPhysics: NeverScrollableScrollPhysics(),
      markedDateShowIcon: true,
      markedDateIconMaxShown: 2,
      markedDateMoreShowTotal:
          false, // null for not showing hidden events indicator
      //showHeader: false,
      markedDateIconBuilder: (event) {
        return event.icon;
      },
      todayTextStyle: TextStyle(
        color: Colors.blue,
      ),
      todayButtonColor: Colors.yellow,
      selectedDayTextStyle: TextStyle(
        color: Colors.green,
      ),
      minSelectedDate: _currentDate,
      maxSelectedDate: _currentDate.add(Duration(days: 60)),
//      inactiveDateColor: Colors.black12,
      onCalendarChanged: (DateTime date) {
        this.setState(() => _currentMonth = DateFormat.yMMM().format(date));
      },
      locale: "ja",
    );

    return new Scaffold(
        appBar: new AppBar(
          title: new Text(widget.title),
        ),
        body: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              //custom icon
              Container(
                margin: EdgeInsets.symmetric(horizontal: 16.0),
                child: _calendarCarousel,
              ), // This trailing comma makes auto-formatting nicer for build methods.
            ],
          ),
        ));
  }
}

markedDate only works when time is at 00:00:00.000

Version of flutter_calendar_carousel

1.1.2

Expected behavior

Setting markedDates to list of DateTimes with time set to non-zero should show marks for that day

Actual behavior

No marks unless time is set to 00:00:00.000

flutter doctor result (run flutter doctor in terminal)

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.0)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.2)
[✓] Connected devices (2 available)

• No issues found!

Steps to reproduce the behavior

replace list of DateTimes in sample app with non-zero times

Marked events are not distinguished in week format

Version of flutter_calendar_carousel

1.3.11

Expected behavior

Marked date icons, widgets, and totals should appear by dates in both week and month view.

Actual behavior

Marked date icons, widgets, and totals only appear in month view.

flutter doctor result (run flutter doctor in terminal)

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.1.8, on Mac OS X 10.14.3 18D21c, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.30.2)
[✓] Connected device (1 available)

• No issues found!

Steps to reproduce the behavior

  1. Construct the following widget or similar:
CalendarCarousel<CustomEvent>(
    selectedDateTime: _selectedDate,
    weekFormat: true,
    markedDatesMap: _eventList,
    markedDateMoreShowTotal: true,
    markedDateShowIcon: true,
    markedDateIconMaxShown: 0,
    markedDateIconBuilder: (CalendarItem c) => Container(color: Colors.orange, height: 1.0),
    markedDateMoreCustomDecoration: BoxDecoration(shape: BoxShape.circle, color: Colors.orange),
 ),
  1. Populate the list of events
  2. View on device in both formats

Month format:
screen shot 2019-02-05 at 11 11 06 am

Week format:
screen shot 2019-02-05 at 11 12 35 am

markedDateWidget disappear when weekFormat is enabled

Version of flutter_calendar_carousel

  • 1.3.12

Expected behavior

  • markedDateWidget must still visible

Actual behavior

  • markedDateWidget disappear

flutter doctor result (run flutter doctor in terminal)

[✓] Flutter (Channel dev, v1.2.0, on Mac OS X 10.14.3 18D109, locale en-US)
    • Flutter version 1.2.0 at /Users/nambuivu/flutter
    • Framework revision 06b979c4d5 (4 weeks ago), 2019-01-25 14:27:35 -0500
    • Engine revision 36acd02c94
    • Dart version 2.1.1 (build 2.1.1-dev.3.2 f4afaee422)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/nambuivu/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/nambuivu/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 33.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] IntelliJ IDEA Community Edition (version 2017.2.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 17.0
    • Dart plugin version 172.4155.35

[✓] VS Code (version 1.29.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.21.1

Steps to reproduce the behavior

body: Container(
        margin: EdgeInsets.symmetric(horizontal: 16.0),
        child: CalendarCarousel(
          weekFormat: false,
          weekendTextStyle: TextStyle(
            color: Colors.red,
          ),
          markedDateWidget: Positioned(
            child: Container(
              color: Colors.blueAccent,
              height: 6.0,
              width: 6.0,
            ),
            bottom: 4.0,
            left: 20.0,
          ),
          markedDates: _markedDate,
          height: 420.0,
          selectedDateTime: _currentDate,
          daysHaveCircularBorder: false,
        ),
      ),
);

When the weekFormat is set to true the marked date not working anymore

screen shot 2019-02-20 at 10 46 45 am

screen shot 2019-02-20 at 10 47 05 am

next/prev month buttons customization

Version of flutter_calendar_carousel

1.3.7

arrows

We need to have ability to customize this arrows in more flexible way. We should have possibility to use own Widgets here.

Maybe too much loop?

I was looking in the new PR and I find it really cool. However it seems to me that doing a loop over all the events provided to the calendar might be overkill. If I get it right, we are lopping over each event for each day shown.
If someone wants to provide all the events for 3 months (or the entire year) or he has a lot of events, it can easily grow exponentially the time spent to generate the widgets.

One way to arrange that would be to force someone to use an Events class which have internally a Map<DateTime, List<Event>> and publicly have those functions add(Event), addAll(List<Event>), remove(Event), clear(DateTime) and getEvents(DateTime). By doing this, you just have to call getEvents(DateTime) to check if the key is present and return the list of events.
Moreover, by doing this, we can remove the problem of timezones by explicitly stoking as index of the Map a redefined DateTime: DateTime(event.date.year, event.date.month, event.date.day.

Month displayed on header is incorrect

Version of flutter_calendar_carousel: 1.3.5

Expected behavior : For current date, 4th January 2019, when calendar is shown in week format, the month displayed on the header should be January.

Actual behavior : In the week format, for 4th January 2019, the month displayed on the header is December

Steps to reproduce the behavior: Use the below configuration for the calendar ->

class Calender extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return SliverAppBar(
      automaticallyImplyLeading: false,
      backgroundColor: Colors.white,
      forceElevated: true,
      bottom: PreferredSize(
          child: Divider(
            color: Colors.transparent,
          ),
          preferredSize: Size.fromHeight(52.0)),
      pinned: true,
      flexibleSpace: CalendarCarousel(
          height: 150,
          headerMargin: EdgeInsets.all(0.0),
          width: MediaQuery.of(context).size.width,
          weekFormat: true,
          weekDayMargin: EdgeInsets.only(top: 0.0),
          selectedDayBorderColor: Colors.transparent,
          selectedDayButtonColor: Colors.deepOrange,
          todayBorderColor: Colors.transparent,
          todayButtonColor: Colors.black26,
          childAspectRatio: 1.2,
          onDayPressed: (DateTime date, events) {
            print("selected date is : $date");
          }),
    );
  }
}

Extra row of inactive days

Version of flutter_calendar_carousel

1.3.7

Actual behavior

extra_row

Do we really need this extra row of inactive days in such case?

Week only page

Hi, does this calendar supports weekly calendar? I mean, show only one week each time.
Thanks.

Date Selection does not work anymore

Version of flutter_calendar_carousel

1.3.5

Expected behavior

You can select a different date from todays day

Actual behavior

The selected date cannot be changed from todays date

flutter doctor result (run flutter doctor in terminal)

Steps to reproduce the behavior

Create a carousal and try to change to a different date, ensuring you have a handler for dealing with the date change.

It appears that in line 341 - 344 _selectedDate should be used and not widget. widget.selectedDateTime as the internal caching logic can mean these get out of sync

Ability to enable/disable/change "month change" animation

Version of flutter_calendar_carousel

1.3.7

As for now "month change" animation is enabled only on swipe gesture and we can't customize it. When I'm clicking on next/prev month buttons animation is disabled. Also where is no way to change it. We need animations to be more customizable.

Ability to change week day order

Hi, it would be nice if the calendar supported the option to choose the first day of the week.
I am developing my university campus' student app, and people here in spain are used to calendars and timetables starting on monday and ending on sunday.

Great widget though, best flutter calendar i've found!

Trying to implement markedDateWidget for each event

Version of flutter_calendar_carousel

Fri Feb 15 (f9aa8ec)

I'm trying to implement markedDateWidget for each event, so that blue dots can be colored differently for each event. Having the issue of getting markedDateWidget while doing _renderMarkedMap(DateTime now):

my code:

                var dotIcon = Container(
                      margin: EdgeInsets.symmetric(horizontal: 1.0),
                      color: Colors.red,
                      height: 4.0,
                      width: 4.0,
                    );

                    var event =  new Event(
                      date: date,                    
                      title: 'test event', 
                      markedDateWidget: dotIcon,
                    );

changed event.dart to accept markedDateWidget and having getter "getdot"

import 'package:flutter/material.dart';

class Event {
  final DateTime date;
  final String title;
  final Widget icon;
  final Widget markedDateWidget;

  Event({this.date, this.title, this.icon, this.markedDateWidget}) : assert(date != null);


  Widget get getdot {

    if(markedDateWidget != null)
    {
      return markedDateWidget;
    }
    else
    {
      return null;
    }
  }


  @override
  bool operator ==(other) {
    return this.date == other.date &&
        this.title == other.title &&
        this.icon == other.icon;
        this.markedDateWidget == other.markedDateWidget;
  }
  

}

flutter_calendar_carousel.dart


  List<Widget> _renderMarkedMap(DateTime now) {
    if (widget.markedDatesMap != null &&
        widget.markedDatesMap.getEvents(now).length > 0) {
      List<Widget> tmp = [];
      int count = 0;    
      double offset = 0.0;
      double padding = widget.markedDateIconMargin;
      widget.markedDatesMap.getEvents(now).forEach((event) {
        if (widget.markedDateShowIcon) {

         //...
         // removed for clarity
        //...

        } else {

          //check if custom markedDateWidget supplied for event

          var dot = event.getdot;   //DOES NOT WORK HERE     (accessing any event properties does not work)
          //var dot = event.markedDateWidget;  //also does not work 

          if(dot != null)
              {
                tmp.add(dot);
              }
              else
              {

                if (widget.markedDateWidget != null) {
                  tmp.add(widget.markedDateWidget);
                } else {
                  tmp.add(defaultMarkedDateWidget);
                }

              }
 
        }
 
      });
      return tmp;
    }
    return [];
  }

Error:

Error: The getter 'getdot' isn't defined for the class 'dart.core::Object'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'getdot'.
          var dot = event.getdot;
                          ^^^^^^

How can I access event properties inside _renderMarkedMap() function? Any help would be appreciated, will submit PR once I have it working.

Trying to achieve something like this:
50043736-ece82800-00bc-11e9-84ca-ea71290a43b7

Need to update readme.md

flutter_calendar_carousel: ^1.2.2

The example in the readme.md is incorrect and references old code. the one in the example worked great.

prevDaysTextStyle and prevDaysTextStyle should overwrite weekendTextStyle

Good day, hyochan! Thank you for this great widget.
Can you fix prevDaysTextStyle and prevDaysTextStyle priority over weekendTextStyle? Maybe it should be optional ability, but they should overwrite weekendTextStyle.

download

I am expecting that marked days will be grey (prev and next month), but they aren't.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.