flutter-examples icon indicating copy to clipboard operation
flutter-examples copied to clipboard

How to give height for the date cell ?

Open naveenbarath99 opened this issue 1 year ago • 6 comments

Hi i'm trying to give height for the date cell but its not taking the height, if it goes for the smaller screen means the height of the cell is decreasing so i need to give fixed height for the Date cell. I'll attach my code also

SfCalendar( cellBorderColor: whiteColor, view: CalendarView.month, controller: controller, showDatePickerButton: true, showNavigationArrow: false, onViewChanged: onViewChanged, dataSource: calendarDataSource, monthViewSettings: MonthViewSettings(showAgenda: true, numberOfWeeksInView: monthOrWeek), timeSlotViewSettings: const TimeSlotViewSettings( minimumAppointmentDuration: Duration(minutes: 60)), onTap: (CalendarTapDetails details) { if (details.targetElement.name.toString() == 'appointment') { Navigator.pushNamed(context, calendarEventDetailRoute); } }, appointmentBuilder: (BuildContext context, CalendarAppointmentDetails details) { return Row( mainAxisSize: MainAxisSize.max, children: [ Container( height: double.infinity, width: 2, color: Colors.blue, ), Container( width: MediaQuery.of(context).size.width * 0.76, decoration: BoxDecoration( color: Colors.blue.withOpacity(0.4), ), padding: const EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ const Text( "Event name", style: TextStyle( color: Colors.white, ), ), Text( Utils().getUSDate(details.date.toString()), style: const TextStyle( color: Colors.white, ), ), ], ), ), ], ); }, )

2198bb8c-0093-4787-8560-7c23a2a6ed60

naveenbarath99 avatar Oct 13 '23 05:10 naveenbarath99

Hi,

As per the calendar behavior to render the calendar we need 6 rows, using the NumberOfWeeksInView property we can customize it. So that the calendar month cell height will be arranged based on the number of weeks and available height of calendar. Also, using the ShowLeadingAndTrailingDays property we can hide the previous or next month dates. We hope that this information helps you. Please let us know if you need further assistance.

Regards, Indumathi R

IndumathiR-1995 avatar Oct 16 '23 07:10 IndumathiR-1995

Hi Team,

Thanks for the reply, when i'm giving numberOfWeeksInView as 1 its taking too much of height but i need as Fixed height of the row. And the event is listing is taking limited space to show if we need to see remaining events means we need to scroll and see.

For your reference i'm attaching the screen shot also below.

simulator_screenshot_-iphone_15_pro_max-_2023-10-17_at_14 41 20_720

Thank you.

naveenbarath99 avatar Oct 17 '23 09:10 naveenbarath99

Hi,

We have a KB documentation for adding the custom agenda view in the Flutter Calendar. Please find the documentation from the following link.

KB link: https://support.syncfusion.com/kb/article/9607/how-to-show-a-custom-agenda-view-in-the-flutter-calendar

We hope that this helps you. Please let us know if you need further assistance.

Regards, Indumathi R

IndumathiR-1995 avatar Dec 08 '23 11:12 IndumathiR-1995

Hey, I have solved this issue,If u want I can do it for you??please ,let me know do u need any help.

SourabhKumar11 avatar Jan 07 '24 10:01 SourabhKumar11

Hi @SourabhKumar11 ,

We have checked your query at our end and as we are not able to understand what your proposing as your requirement, we kindly request you to share us with more information on your requirement in detail along with screenshots/screenrecordings so that it will help us assist you in a better way.

LavanyaGowtham2021 avatar Feb 14 '24 09:02 LavanyaGowtham2021

HI Team any news about the issue? @IndumathiR-1995 Thanks for sharing that resource it's related to the agenda view, but we would like to know if there is the possibility of having fixed height for day cell.

image

I will be grateful for any suggestions.

Best Regards, Kamil

kkalisz avatar Feb 28 '24 21:02 kkalisz