ResourceViewSettings constructor

const ResourceViewSettings({
  1. double size = 75,
  2. int visibleResourceCount = -1,
  3. bool showAvatar = true,
  4. TextStyle? displayNameTextStyle,
  5. double? height,
  6. double? width,
})

Creates resource view settings for SfCalendar.

Use this to customize the size, layout, and appearance of the resource view.

size — Sets both the resource panel width and each resource item's height. Defaults to 75.

height — Sets the height for each resource item when given explicitly. Ignored when visibleResourceCount > 0. Falls back to size when null.

width — Sets the width for the resource panel when given explicitly. Falls back to size when null.

visibleResourceCount — When greater than 0, splits the available vertical space equally among visible resources, overriding both height and size.

showAvatar — Indicates whether a circular avatar is shown for each resource. Defaults to true.

displayNameTextStyle — Text style used for the display name of each resource.

Behavior and precedence

  • If height or width is provided, the provided value is used.
  • If neither is provided, size is used for both dimensions.
  • When visibleResourceCount > 0, it takes precedence for resource item height over both height and size.

Implementation

const ResourceViewSettings({
  this.size = 75,
  this.visibleResourceCount = -1,
  this.showAvatar = true,
  this.displayNameTextStyle,
  this.height,
  double? width,
}) : width = width ?? size,
     assert(size >= 0),
     assert(visibleResourceCount >= -1);