How to specify a dynamic appointment height ?

Hello,

In Resouce view, timelineday, I'm looking for specify a dynamic height to appointments, like the code bellow (but it isn't working) :

appointmentBuilder: (BuildContext context, CalendarAppointmentDetails calendarAppointmentDetails) {
    final Appointment appointment = calendarAppointmentDetails.appointments.first;
    var rng = Random();
    return Container(
        color: Colors.blue,
        width: calendarAppointmentDetails.bounds.width,
        height: 0.0 + rng.nextInt(100),
        child: Text(appointment.subject),
    );
},

Is there a way to disable this "autofit" mode ?

I've tried this setting bellow, but doesn't seems to impact render

timeSlotViewSettings: const TimeSlotViewSettings( timelineAppointmentHeight: -1 ),


Thanks a lot !


1 Reply

IR Indumathi Ravichandran Syncfusion Team October 27, 2021 10:48 AM UTC

Hi FloPoc, 
 
Thank you for contacting Syncfusion support. 
 
Regarding Query: I'm looking for specify a dynamic height to appointments, like the code below (but it isn't working)  
 
As per the implementation of the calendar, the height set to the appointmentBuilder will be set to the designed UI, but however the builder will occupy the space specified in the timelineAppointmentHeight property, and if the designed UI has minimum height the remaining height will display as the free space, and if the designed UI has maximum height the UI will be cropped and fit into the timelineAppointmentHeight property, there is no direct support to set dynamic height for appointments in calendar. 
 
We hope that this helps you. Please let us know if you need further assistance. 
 
Regards, 
Indumathi R 


Loader.
Up arrow icon