Day, week and month calendar with appointment editing. All-day end dates are exclusive; recurrence, resources and drag-and-drop are unavailable.
TxScheduler
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| dataSource | Object? | null | List, configuration or DataSource instance; takes precedence over items. |
| onDataSourceChanged | ValueChanged<List<TxAppointment>>? | null | Reports dataSource; update controlled state in the callback. |
| currentDate | DateTime? | null | Current calendar date; update a controlled value for navigation. |
| onCurrentDateChanged | ValueChanged<DateTime>? | null | Reports currentDate; update controlled state in the callback. |
| currentView | TxSchedulerView? | null | Current calendar view. |
| onCurrentViewChanged | ValueChanged<TxSchedulerView>? | null | Reports currentView; update controlled state in the callback. |
| views | List<TxSchedulerView> | const [TxSchedulerView.day, TxSchedulerView.week, TxSchedulerView.month] | Available calendar views. |
| firstDayOfWeek | int | 1 | First weekday; 1 = Monday. |
| startDayHour | int | 8 | First visible hour of the day. |
| endDayHour | int | 18 | Last visible hour of the day. |
| cellDuration | int | 30 | Calendar cell duration in minutes. |
| editing | TxSchedulerEditing | const TxSchedulerEditing() | Permissions to create, update and delete. |
| readOnly | bool | false | Prevents value changes. |
| disabled | bool | false | Disables interaction. |
| loading | bool | false | Shows the loading state. |
| locale | String | 'de' | Locale for date/time formatting. |
| label | String | 'Terminplaner' | Label or accessible name. |
| appointmentBuilder | Widget Function(BuildContext context, TxAppointment item, TxSchedulerView view)? | null | Builds custom content; callback arguments and return type are given in the signature. |
| onAppointmentClick | ValueChanged<TxAppointment>? | null | Reports the activated TxAppointment. |
| onCellClick | void Function(DateTime start, DateTime end, bool allDay)? | null | Reports cell start, cell end and the all-day flag as three arguments. |
| onAppointmentAdding | ValueChanged<TxChange<TxAppointment>>? | null | Before insertion: TxChange<TxAppointment>; set cancel synchronously to abort. |
| onAppointmentUpdating | ValueChanged<TxChange<TxAppointmentUpdate>>? | null | Before updating: TxChange<TxAppointmentUpdate> with old and new appointments; synchronously cancellable. |
| onAppointmentDeleting | ValueChanged<TxChange<TxAppointment>>? | null | Before deletion: TxChange<TxAppointment>; set cancel synchronously to abort. |
| onAppointmentAdded | ValueChanged<TxAppointment>? | null | Reports the locally inserted TxAppointment. |
| onAppointmentUpdated | ValueChanged<TxAppointmentUpdate>? | null | Reports TxAppointmentUpdate containing old and new appointments. |
| onAppointmentDeleted | ValueChanged<TxAppointment>? | null | Reports the locally deleted TxAppointment. |
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';
Widget example() {
var appointments = [TxAppointment(id: 1, text: 'Meeting', startDate: DateTime(2026, 10, 28, 9), endDate: DateTime(2026, 10, 28, 10))];
return StatefulBuilder(
builder: (context, setState) => TxScheduler(dataSource: appointments, onDataSourceChanged: (v) => setState(() => appointments = v)),
);
}