Card collection with search, paging, selection and custom content.
TxCardView
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| dataSource | Object | required | List, configuration or DataSource instance; takes precedence over items. |
| keyOf | Object Function(T row) | required | Reads the stable record key. |
| titleOf | String Function(T row) | required | Card title getter. |
| subtitleOf | String? Function(T row)? | null | Card subtitle getter. |
| imageOf | String? Function(T row)? | null | Card image URL getter. |
| imageAltOf | String? Function(T row)? | null | Image alternative text getter. |
| columns | List<TxCardField<T>> | const [] | Column or card field configurations. |
| searchEnabled | bool | true | Enables searching. |
| searchTextOf | String? Function(T row)? | null | Searchable card text getter. |
| pageSize | int | 6 | Records per page. |
| pageIndex | int? | null | Zero-based page index. |
| onPageIndexChanged | ValueChanged<int>? | null | Reports pageIndex; update controlled state in the callback. |
| selection | TxSelectionMode | TxSelectionMode.none | Selection mode. |
| selectedCardKeys | Set<Object>? | null | Controlled set of selected card keys. |
| onSelectedCardKeysChanged | ValueChanged<Set<Object>>? | null | Reports selectedCardKeys; update controlled state in the callback. |
| onSelectionChanged | ValueChanged<TxSelection<T>>? | null | Reports selection; update controlled state in the callback. |
| onCardClick | ValueChanged<T>? | null | Reports the record activated through the details action. |
| onSearchChanged | ValueChanged<String>? | null | Reports search; update controlled state in the callback. |
| loading | bool | false | Shows the loading state. |
| disabled | bool | false | Disables interaction. |
| noDataText | String | 'Keine Karten vorhanden.' | Text for an empty collection. |
| label | String | 'Kartenansicht' | Label or accessible name. |
| itemBuilder | Widget Function(BuildContext context, T row, bool selected)? | null | Builds custom content; callback arguments and return type are given in the signature. |
| mediaBuilder | Widget Function(BuildContext context, T row)? | null | Builds custom content; callback arguments and return type are given in the signature. |
| contentBuilder | Widget Function(BuildContext context, T row)? | null | Builds custom content; callback arguments and return type are given in the signature. |
| footerBuilder | Widget Function(BuildContext context, T row)? | null | Builds custom content; callback arguments and return type are given in the signature. |
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';
Widget example() {
final rows = <Map<String, Object>>[{'id': 1, 'name': 'Alex'}];
return TxCardView<Map<String, Object>>(dataSource: rows, keyOf: (row) => row['id']!, titleOf: (row) => '${row['name']}');
}