Skip to content

Commit 7a84f2d

Browse files
Merge pull request #1386 from syncfusion-content/FLUT-974270-height
FLUT-974270- [Others] Added height and width in resourceViewSettings of SfCalendar
2 parents 2536a48 + 80f8a89 commit 7a84f2d

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

87.7 KB
Loading

Flutter/calendar/resource-view.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,38 @@ Widget build(BuildContext context) {
129129

130130
![Visible resource count](images/resourceview/visible_resource_count.png)
131131

132+
## Height and Width
133+
You can customize the height or width of the resource view individually using the `height` and `width` properties of [ResourceViewSettings](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/ResourceViewSettings-class.html) in the [SfCalendar](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/SfCalendar-class.html).
134+
135+
- **height** — Sets the height of each individual resource item. Use this when you want fixed control over row height.
136+
- **width** — Sets the total width of the entire resource view panel. Use this when you want fixed control over panel width.
137+
- **size** — Applies the same value to both the height and width of resource view. The `height` or `width` property takes first precedence over `size` property when given explicitly.
138+
- **visibleResourceCount** — When `visibleResourceCount` is set (> 0), the calendar automatically calculates the height of each resource item based on the available space and the number of visible resources. In this case, an explicitly set `height` value is ignored.
139+
140+
{% tabs %}
141+
{% highlight dart hl_lines="8" %}
142+
143+
@override
144+
Widget build(BuildContext context) {
145+
return MaterialApp(
146+
home: Scaffold(
147+
body: SfCalendar(
148+
dataSource: _dataSource,
149+
resourceViewSettings: ResourceViewSettings(
150+
height: 100,
151+
width: 250,
152+
// size: 120, // used only when `width` is not provided
153+
// visibleResourceCount: 2, // when set, determines row height instead of `height`
154+
),
155+
)),
156+
);
157+
}
158+
159+
{% endhighlight %}
160+
{% endtabs %}
161+
162+
![height and width](images/resourceview/height_width.png)
163+
132164
## Customization
133165
### Show avatar
134166
You can disable the user profile image and the circle representation of the resource by setting `false` to the [showAvatar](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/ResourceViewSettings/showAvatar.html) property available in the [ResourceViewSettings](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/ResourceViewSettings-class.html). This will display each resource with a resource name and the color assigned to the resource.
@@ -199,8 +231,10 @@ Widget build(BuildContext context) {
199231

200232
![Resource panel size](images/resourceview/resource_panel_size.png)
201233

234+
> When `width` is specified along with [size](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/ResourceViewSettings/size.html), `width` takes precedence.
235+
202236
## See also
203237

204238
* [How to add appointment for the selected resources using appointment editor in Flutter event calendar (SfCalendar)?](https://support.syncfusion.com/kb/article/10550)
205239
* [How to add resources in the Flutter event calendar (SfCalendar)](https://support.syncfusion.com/kb/article/10393/how-to-add-resources-in-the-flutter-calendar)
206-
* [How to customize the resource view in the Flutter event calendar (SfCalendar)](https://support.syncfusion.com/kb/article/10738/how-to-customize-the-resource-view-in-the-flutter-calendar)
240+
* [How to customize the resource view in the Flutter event calendar (SfCalendar)](https://support.syncfusion.com/kb/article/10738/how-to-customize-the-resource-view-in-the-flutter-calendar)

0 commit comments

Comments
 (0)