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

inconsistency in MonthView #435

Open
bsutton opened this issue Dec 29, 2024 · 5 comments
Open

inconsistency in MonthView #435

bsutton opened this issue Dec 29, 2024 · 5 comments
Assignees
Labels
potential-enhancement This label defines that we might work on this enhancement in future but can not make any promises.

Comments

@bsutton
Copy link

bsutton commented Dec 29, 2024

The DayView and the WeekView both have a 'backgroundColor' argument however the MonthView doesn't.

I'm trying to display the calendar in dark mode hence the requirement to sent the background color to black.

@shubham-jitiya-simform
Copy link
Contributor

shubham-jitiya-simform commented Dec 30, 2024

Hi @bsutton,
In month view you can use FilledCell which has backgroundColor property or return your own custom widget.
For dark theme support refer PR #431

Please refer this default cell builder

  Widget _defaultCellBuilder(
    date,
    List<CalendarEventData<T>> events,
    isToday,
    isInMonth,
    hideDaysNotInMonth,
  ) {
    if (hideDaysNotInMonth) {
      return FilledCell<T>(
        date: date,
        shouldHighlight: isToday,
        backgroundColor: isInMonth ? Constants.white : Constants.offWhite,
        events: events,
        isInMonth: isInMonth,
        onTileTap: widget.onEventTap,
        dateStringBuilder: widget.dateStringBuilder,
        hideDaysNotInMonth: hideDaysNotInMonth,
      );
    }
    return FilledCell<T>(
      date: date,
      shouldHighlight: isToday,
      backgroundColor: isInMonth ? Constants.white : Constants.offWhite,
      events: events,
      onTileTap: widget.onEventTap,
      onTileLongTap: widget.onEventLongTap,
      dateStringBuilder: widget.dateStringBuilder,
      onTileDoubleTap: widget.onEventDoubleTap,
      hideDaysNotInMonth: hideDaysNotInMonth,
    );
  }

@shubham-jitiya-simform shubham-jitiya-simform added the duplicate This issue or pull request already exists label Dec 30, 2024
@bsutton
Copy link
Author

bsutton commented Dec 30, 2024 via email

@bsutton
Copy link
Author

bsutton commented Dec 30, 2024 via email

@bsutton
Copy link
Author

bsutton commented Jan 1, 2025

it's also missing onTileLongTap.

@shubham-jitiya-simform shubham-jitiya-simform added potential-enhancement This label defines that we might work on this enhancement in future but can not make any promises. and removed duplicate This issue or pull request already exists labels Jan 2, 2025
PRBaraiya added a commit that referenced this issue Jan 2, 2025
…_view

fix: Fixes issue #435: 🐛 Fix tap issue for days not in month
@shubham-jitiya-simform
Copy link
Contributor

shubham-jitiya-simform commented Jan 3, 2025

also is there a reason why the second call to FilledCell in _defaultCellBuilder is missing the 'onTileDoubleTap' argument. It looks like it might be a bug?

Hi, @bsutton
We appreciate you bringing the missing taps to our attention.
The necessary changes have now been successfully merged in PR #440.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential-enhancement This label defines that we might work on this enhancement in future but can not make any promises.
Projects
None yet
Development

No branches or pull requests

2 participants