Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple days selection #284

Merged
merged 5 commits into from
Jul 29, 2021

Conversation

takumade
Copy link
Contributor

@takumade takumade commented Jul 27, 2021

Multiple days selection

Users can programmatically selected more days at once

So here are the steps to do it

  1. Create a MultipleMarkedDates instance:
MultipleMarkedDates multipleMarkedDates = new MultipleMarkedDates(markedDates: []);
  1. Add marked dates to it
multipleMarkedDates.add(new MarkedDate(date: DateTime(2021, 7, 12), color: Colors.purple));
multipleMarkedDates.add(new MarkedDate(date: DateTime(2021, 7, 13), color: Colors.purple));
multipleMarkedDates.add(new MarkedDate(date: DateTime(2021, 7, 14), color: Colors.purple));
multipleMarkedDates.add(new MarkedDate(date: DateTime(2021, 7, 2), color: Colors.pink));
multipleMarkedDates.add(new MarkedDate(date: DateTime(2021, 7, 3), color: Colors.pink, textStyle: TextStyle(color: Colors.white)));
multipleMarkedDates.add(new MarkedDate(date: DateTime(2021, 7, 29), color: Colors.deepOrange));
  1. Finally add it to CalendarCarousel using the multipleMarkedDates: prop
final _calendarCarouselNoHeader = CalendarCarousel<Event>(
      ...
      ...
      ...
      multipleMarkedDates: multipleMarkedDates,
     ...
     ...
     ...
    );

More Notes
So for a MarkedDate you can specify the following options/props

props types defaultValues Description Required
date DateTime Specify which date will be selected True
color Color Specify the color of the day True
textStyle TextStyle Specify the TextStyle of the day number False

image

Copy link
Member

@hyochan hyochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the awesome feature! 💯

@hyochan hyochan merged commit 90b96c3 into dooboolab-community:master Jul 29, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants