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})
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
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
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
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