Configuration for the store, keys, query, paging and local or remote processing.
TxDataSourceConfig
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| store | TxStore<T> | required | Data collection or custom store contract. |
| keyOf | TxKeyOf<T>? | null | Reads the stable record key. |
| sort | List<TxSort<T>> | const [] | Sort descriptors in priority order. |
| filter | TxFilter<T>? | null | Filter expression. |
| searchExpr | List<TxGetter<T>> | const [] | Search fields or getters. |
| searchValue | String | '' | Search text; local search ignores case. |
| group | List<TxSort<T>> | const [] | Group descriptors or group name. |
| pageSize | int | 20 | Records per page. |
| pageIndex | int | 0 | Zero-based page index. |
| paginate | bool | true | Enables paging; false loads the whole collection. |
| remoteOperations | bool? | null | Store handles queries itself; automatically enabled for custom stores. |
| select | T Function(T)? | null | Projection before final mapping. |
| map | T Function(T)? | null | Transformation of each loaded visible record. |
| requireTotalCount | bool | true | Requests the total count before paging. |
| requireGroupCount | bool | false | Requests the number of top-level groups. |
import 'package:tecexpress/tecexpress.dart';
Future<void> example() async {
final config = TxDataSourceConfig<int>(store: TxArrayStore([1, 2], keyOf: (v) => v), keyOf: (v) => v, pageSize: 10);
final source = TxDataSource(config);
await source.load();
source.dispose();
}