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

Monthview dark theme is not supported #227

Closed
SachinTanpure opened this issue May 15, 2023 · 3 comments
Closed

Monthview dark theme is not supported #227

SachinTanpure opened this issue May 15, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@SachinTanpure
Copy link

SachinTanpure commented May 15, 2023

I have app which support dark mode but Monthview is not showing in Dark theme when app is in dark mode
I am using calendar_view: ^1.0.3 version

WhatsApp Image 2023-05-15 at 12 31 00 PM

Below is my code

EventController<DashboardCalendarWidgetEventsModel> _eventController=EventController<DashboardCalendarWidgetEventsModel>();
  _getCalendarEventWidget(List<CalendarEventData<DashboardCalendarWidgetEventsModel>> widgetData, {bool isInFullScreen=false}){
    _eventController = EventController<DashboardCalendarWidgetEventsModel>()..addAll(widgetData);
    return CalendarControllerProvider(
      controller: _eventController,
      child: Container(margin: EdgeInsets.only(top: Sizes.SIZE_2),decoration: BoxDecoration(
        border: Border.all(width: Sizes.SIZE_0_5,
          color:  Colors.grey.shade700 ,
        ),
      ),
        child: MonthView(
          controller: _eventController ,
          onCellTap: (events, date) {
            if(events.length > 0)
            _openEventListPopup(events,date,isInFullScreen);
          },
          onEventTap: (event,date){
            _openEventListPopup(_getEventsForSpecificDates(date),date,isInFullScreen);
          },
          cellAspectRatio: 1,
          borderColor: CommonConstants.APP_IS_IN_DARK_MODE ? Colors.grey.shade700 : ColorConstants.lightBlueShade5,
          borderSize: 0.3,
          headerStringBuilder: (date,{secondaryDate}){
            return "${DateFormat.MMM().format(date)} - ${date.year}";
          },
          headerStyle: HeaderStyle(decoration: BoxDecoration(),)
        ),
      ),
    );
  }
@jaiminrana05 jaiminrana05 added the enhancement New feature or request label Aug 4, 2023
@jaiminrana05
Copy link
Collaborator

Hi, @SachinTanpure You can use the cellBuilder property in which you can use FilledCell class to change the backgroundColor of cell or you can create your own custom widget for building cell.

MonthView<Event>( key: state, width: width, cellBuilder: (date, event, isToday, isInMonth) => FilledCell( date: date, events: event, backgroundColor: Colors.greenAccent, ), );

@jaiminrana05 jaiminrana05 added waiting-for-resoponse Waiting for someone to respond. and removed enhancement New feature or request labels Aug 4, 2023
@2zqa
Copy link

2zqa commented Oct 17, 2023

This should probably be the default, using Theme.of(context). I also describe this in #275

@PRBaraiya PRBaraiya added enhancement New feature or request priority:3 Bug/Enhancement with priority level 3. and removed waiting-for-resoponse Waiting for someone to respond. labels Nov 1, 2023
@PRBaraiya
Copy link
Collaborator

Refer #263 for updates

@PRBaraiya PRBaraiya removed the priority:3 Bug/Enhancement with priority level 3. label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants