TCrudTable<T, K, F extends TFormBase> constructor
const
TCrudTable<T, K, F extends TFormBase> ({
- Key? key,
- required List<
TTableHeader< headers,T> > - List<
T> ? items, - TLoadListener<
T> ? onLoad, - List<
T> ? archivedItems, - TLoadListener<
T> ? onArchiveLoad, - F createForm()?,
- F editForm(
- T item
- Future<
T?> onCreate(- F form
- Future<
void> onView(- T item
- Future<
T?> onEdit(- T item,
- F form
- Future<
bool> onArchive(- T item
- Future<
bool> onRestore(- T item
- Future<
bool> onDelete(- T item
- TCrudConfig<
T, K> config = const TCrudConfig(), - TListController<
T, K> ? controller, - TListController<
T, K> ? archiveController, - Widget expandedBuilder(
- T item,
- int index
Implementation
const TCrudTable({
super.key,
required this.headers,
this.items,
this.onLoad,
this.archivedItems,
this.onArchiveLoad,
this.createForm,
this.editForm,
this.onCreate,
this.onView,
this.onEdit,
this.onArchive,
this.onRestore,
this.onDelete,
this.config = const TCrudConfig(),
this.controller,
this.archiveController,
this.expandedBuilder,
}) : assert(
(controller == null && (items != null || onLoad != null)) || (controller != null && items == null && onLoad == null),
'Provide either `controller` OR (`items` / `onLoad`), not both.',
),
assert(
(archiveController == null && (archivedItems != null || onArchiveLoad != null)) ||
(archiveController != null && archivedItems == null && onArchiveLoad == null),
'Provide either `archiveController` OR (`archivedItems` / `onArchiveLoad`), not both.',
);