ResourceViewSettings class
The settings have properties which allow to customize the resource view of the SfCalendar.
Allows to customize the visibleResourceCount,showAvatar, size, and displayNameTextStyle in resource view of calendar.
See also:
- CalendarResource, the resource data for calendar.
- CalendarDataSource.resources, the collection of resource to be displayed in the timeline views of SfCalendar.
@override
Widget build(BuildContext context) {
return Container(
child: SfCalendar(
view: CalendarView.timelineMonth,
dataSource: _getCalendarDataSource(),
resourceViewSettings: ResourceViewSettings(
visibleResourceCount: 4,
size: 150,
displayNameTextStyle: TextStyle(
fontStyle: FontStyle.italic,
fontSize: 15,
fontWeight: FontWeight.w400)),
),
);
}
}
class DataSource extends CalendarDataSource {
DataSource(List<Appointment> source, List<CalendarResource> resourceColl) {
appointments = source;
resources = resourceColl;
}
}
DataSource _getCalendarDataSource() {
List<Appointment> appointments = <Appointment>[];
List<CalendarResource> resources = <CalendarResource>[];
appointments.add(Appointment(
startTime: DateTime.now(),
endTime: DateTime.now().add(Duration(hours: 2)),
isAllDay: true,
subject: 'Meeting',
color: Colors.blue,
resourceIds: <Object>['0001'],
startTimeZone: '',
endTimeZone: ''));
resources.add(
CalendarResource(displayName: 'John', id: '0001', color: Colors.red));
return DataSource(appointments, resources);
}
- Annotations
Constructors
Properties
- displayNameTextStyle → TextStyle
-
The text style for the text in the CalendarResource view of
SfCalendar. [...]
final
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- showAvatar → bool
-
Shows a circle that represents a user. [...]
final
- size → double
-
The size of the resource view panel in timeline views of SfCalendar. [...]
final
- visibleResourceCount → int
-
The number of resources to be displayed in the available screen height in
SfCalendar [...]
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited