Change height of resource and fix it on top
i am currently working on a SfCalendar in Flutter and I want to change the height of a resource to make it display the full information on the board. Like on my Screenshot the Resource "N/A":
So the user drags the unassigned appointment, that will be loaded in Resource "N/A" to the technican like here to "T B".
Because there is lot of data in "N/A", the Text of the appointment is not showed but should be. Also, is it possible to fix the row with resource "N/A" on the top, so, when the user scrolls down, "N/A" group is always on screen?
Here is the code-snipped from the base SfCalendar Function and from the _resourceHeaderBuilder:
/// Returns the calendar widget based on the properties passed
SfCalendar _getMeetingRoomCalendar(
[CalendarDataSource? _calendarDataSource, dynamic viewChangedCallback]) {
return SfCalendar(
showDatePickerButton: true,
controller: _calendarController,
allowDragAndDrop: true,
allowedViews: _allowedViews,
minDate: _minDate,
timeRegionBuilder: _getSpecialRegionWidget,
specialRegions: _specialTimeRegions,
showNavigationArrow: true,
dataSource: _calendarDataSource,
onViewChanged: viewChangedCallback,
resourceViewHeaderBuilder: _resourceHeaderBuilder,
appointmentTimeTextFormat: 'HH:mm',
timeSlotViewSettings: TimeSlotViewSettings(
timeInterval: Duration(minutes: 15),
timeFormat: 'HH:mm',
startHour: 7,
endHour: 18,
),
);
}
/// Returns the widget for resource header.
Widget _resourceHeaderBuilder(
BuildContext context, ResourceViewHeaderDetails details) {
final Random random = Random();
int capacity = 0;
if (_visibleAppointments.isNotEmpty) {
capacity = 0;
for (int i = 0; i < _visibleAppointments.length; i++) {
final Appointment visibleApp = _visibleAppointments[i];
if (visibleApp.resourceIds != null &&
visibleApp.resourceIds!.isNotEmpty &&
visibleApp.resourceIds!.contains(details.resource.id)) {
capacity++;
}
}
}
String capacityString = 'Termine';
return Container(
height: 1000,
child: Container(
color: details.resource.color,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
icons[random.nextInt(5).toInt()],
Text(
details.resource.displayName,
style: const TextStyle(
color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
),
Padding(
padding: const EdgeInsets.only(top: 5),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
const Text(
'Termine: ',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 10,
),
),
Container(
child: Text(
capacity.toString(),
textAlign: TextAlign.center,
style: const TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.bold),
),
)
],
),
)
],
),
)
);
}
}
I have tried it to set TimeSlotViewSettings() with height, but there was no change, also I tried to gave the Container in _resourceHeaderBuilder a height, but there was also no change.
Thank you.
Hi,
We have logged the feature request for the “Height support for resource view in the Flutter event calendar (SfCalendar)”. We will implement this feature in any of our upcoming releases.
Now you can track the status of the feature report by using the following link.
Feature link:
https://www.syncfusion.com/feedback/29362/height-parameter-for-resource-view
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.
We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.
If you have any more specifications/suggestions for the feature request, you can add it as a comment in the portal and cast your vote to make it count.
Regards,
Indumathi R
Hei!
SfCalendarissa resurssirivin korkeutta ei voi muuttaa suoraan resourceHeaderBuilder-widgetin height-arvolla – korkeus määräytyy kalenterin sisäisesti. Siksi tekemäsi muutos ei vaikuta.
Ratkaisu:
-
Voit kasvattaa rivin sisältöä epäsuorasti muuttamalla esimerkiksi
timeSlotViewSettings→timeIntervalHeight, mikä antaa enemmän tilaa myös näkymälle. -
Jos teksti ei näy, käytä lyhyempää tekstiä tai mukauta
appointmentBuilder-widgetiä näyttämään sisältö paremmin.
“N/A” rivin kiinnittäminen ylös:
- Tätä ei valitettavasti tueta suoraan SfCalendarissa.
- Workaround: laita “N/A” erilliseen widgetiin kalenterin yläpuolelle tai käsittele se erillisenä resurssina UI:ssa.
Lopuksi: Suomessa ALV:n laskemiseen voit käyttää ALV-laskuri, joka auttaa arvonlisäveron nopeassa laskemisessa.
Hi Mark,
Thank you for your valuable suggestion. We are now proceeding to close this forum. Should you have any further questions or require additional assistance, please do not hesitate to contact us.
Regards,
Mugunthan.
- 3 Replies
- 4 Participants
-
LF Lukas Fürst
- May 10, 2023 08:35 PM UTC
- Apr 17, 2026 04:58 AM UTC
