You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to update selected date color to a custom color but could't found any property like selected date.
Is it possible to highlight the date when I click on any cell ?
I want to update selected date color to a custom color but could't found any property like selected date.
Is it possible to highlight the date when I click on any cell ?
Code :
MonthView(
controller: calendarController.eventController,
cellAspectRatio: 1.2,
width: 345.w,
initialMonth: DateTime.now(),
minMonth: DateTime.now(),
maxMonth: DateTime.now().add(const Duration(days: 365)),
showBorder: false,
headerStyle: const HeaderStyle(
decoration: BoxDecoration(
color: AppColor.transparent,
),
),
cellBuilder: (date, event, isToday, isInMonth) {
return Container(
decoration: BoxDecoration(
color: isToday ? AppColor.primaryColor : AppColor.transparent,
borderRadius: BorderRadius.circular(10.r),
),
child: Center(
child: Text(
date.day.toString(),
style: TextStyle(
color: isToday ? Colors.white : Colors.black,
fontWeight: FontWeight.bold,
),
),
),
);
},
weekDayBuilder: (day) => SizedBox(
height: 20.h,
child: Center(
child: Text(
calendarController.days[day],
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
),
),
headerStringBuilder: (date, {secondaryDate}) {
return '${calendarController.months[date.month - 1]} ${date.year}';
},
headerBuilder: (date) => SizedBox(
height: 50.h,
child: Container(
decoration: const BoxDecoration(
color: AppColor.transparent,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
onPressed: () {},
icon: const Icon(
Icons.arrow_back_ios,
color: Colors.black,
),
),
Text(
'${calendarController.months[date.month - 1]} ${date.year}',
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
IconButton(
onPressed: () {},
icon: const Icon(
Icons.arrow_forward_ios,
color: Colors.black,
),
),
],
),
),
),
onCellTap: (events, date) {},
)
The text was updated successfully, but these errors were encountered: