TCrudConfig<T, K> class

Configuration for TCrudTable.

TCrudConfig defines permission checks, UI labels, tabs, and actions available in the CRUD interface.

Constructors

TCrudConfig({Future<bool> canView(T)?, Future<bool> canEdit(T)?, Future<bool> canDelete(T)?, Future<bool> canArchive(T)?, Future<bool> canRestore(T)?, String addButtonText = 'Add New', List<TTab<int>>? tabs, List<TCrudTableContent<T, K>> tabContents = const [], String searchPlaceholder = 'Search...', bool showActions = true, int itemsPerPage = 0, List<int> itemsPerPageOptions = const [5, 10, 15, 25, 50], List<TCrudCustomAction<T>> activeActions = const [], List<TCrudCustomAction<T>> archiveActions = const [], List<Widget> topBarActions = const [], double actionButtonWidth = 50.0, void onTabChange(int tab)?, bool? dense, bool flatActions = true, bool? optionalPaginationBar, String? storageKey, bool? persistSettings = true})
Creates a CRUD configuration.
const

Properties

actionButtonWidth double
Width of the action buttons column.
final
activeActions List<TCrudCustomAction<T>>
Custom actions available for active items.
final
addButtonText String
Text for the "Add New" button.
final
archiveActions List<TCrudCustomAction<T>>
Custom actions available for archived items.
final
canArchive Future<bool> Function(T)?
Check if archiving is allowed.
final
canDelete Future<bool> Function(T)?
Check if deletion is allowed.
final
canEdit Future<bool> Function(T)?
Check if editing is allowed.
final
canRestore Future<bool> Function(T)?
Check if restoring is allowed.
final
canView Future<bool> Function(T)?
Check if viewing details is allowed.
final
dense bool?
Whether the table layout should be dense.
final
flatActions bool
Whether to render action buttons flat (inline/independently) instead of the default hoverable dropdown menu.
final
hashCode int
The hash code for this object.
no setterinherited
itemsPerPage int
Default number of items per page.
final
itemsPerPageOptions List<int>
Options for items per page dropdown.
final
onTabChange → void Function(int tab)?
Callback fired when a tab is selected.
final
optionalPaginationBar bool?
Whether the footer pagination bar is skipped when there's only 1 page and no more items.
final
persistSettings bool?
Whether to persist table layout settings (dense layout, view mode) per route or storageKey. Defaults to true.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchPlaceholder String
Placeholder text for the search bar.
final
showActions bool
Whether to show the actions column.
final
storageKey String?
Optional unique key to identify and persist table layout settings (dense layout, view mode). If null, settings are automatically persisted by the current route name.
final
tabContents List<TCrudTableContent<T, K>>
Content definitions for each tab.
final
tabs List<TTab<int>>?
Tab definitions for the table view.
final
topBarActions List<Widget>
Custom actions to display in the top bar.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited