flutter-examples
flutter-examples copied to clipboard
How to give height for the date cell ?
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, ), ), ], ), ), ], ); }, )
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
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.
Thank you.
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
Hey, I have solved this issue,If u want I can do it for you??please ,let me know do u need any help.
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.
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.
I will be grateful for any suggestions.
Best Regards, Kamil