TCrudFormPosition enum
A complete CRUD (Create, Read, Update, Delete) table component.
TCrudTable provides a full-featured data table with:
- Create, edit, view, archive, restore, and delete operations
- Form-based create/edit dialogs
- Active and archive tabs
- Permission-based action visibility
- Expandable rows
- Server-side or client-side data
- Custom actions
Basic Usage
TCrudTable<Product, int, ProductForm>(
headers: productHeaders,
items: products,
createForm: () => ProductForm(),
editForm: (product) => ProductForm.fromProduct(product),
onCreate: (form) async {
return await api.createProduct(form.toJson());
},
onEdit: (product, form) async {
return await api.updateProduct(product.id, form.toJson());
},
onArchive: (product) async {
await api.archiveProduct(product.id);
return true;
},
)
With Archive Support
TCrudTable<User, int, UserForm>(
headers: userHeaders,
onLoad: (options) async {
final response = await api.getUsers(options);
return TLoadResult(
response.users,
response.total,
);
},
onArchiveLoad: (options) async {
final response = await api.getArchivedUsers(options);
return TLoadResult(
response.users,
response.total,
);
},
onRestore: (user) async {
await api.restoreUser(user.id);
return true;
},
onDelete: (user) async {
await api.deleteUser(user.id);
return true;
},
)
Type parameters:
T: The type of items in the tableK: The type of the item keyF: The form type (must extend TFormBase)
See also: Position where the form is shown.
Values
- inline → const TCrudFormPosition
-
Show the form in-page (above table or replacing the row).
- dialog → const TCrudFormPosition
-
Show the form in a dialog modal.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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
Constants
-
values
→ const List<
TCrudFormPosition> - A constant List of the values in this enum, in order of their declaration.