t×tecexpressby TeKOcloud
DEv0.7.1
API & types / FLUTTER

TxDataSourceConfig.

Configuration for the store, keys, query, paging and local or remote processing.

TxDataSourceConfig

ParameterTypeDefaultMeaning
storeTxStore<T>requiredData collection or custom store contract.
keyOfTxKeyOf<T>?nullReads the stable record key.
sortList<TxSort<T>>const []Sort descriptors in priority order.
filterTxFilter<T>?nullFilter expression.
searchExprList<TxGetter<T>>const []Search fields or getters.
searchValueString''Search text; local search ignores case.
groupList<TxSort<T>>const []Group descriptors or group name.
pageSizeint20Records per page.
pageIndexint0Zero-based page index.
paginatebooltrueEnables paging; false loads the whole collection.
remoteOperationsbool?nullStore handles queries itself; automatically enabled for custom stores.
selectT Function(T)?nullProjection before final mapping.
mapT Function(T)?nullTransformation of each loaded visible record.
requireTotalCountbooltrueRequests the total count before paging.
requireGroupCountboolfalseRequests the number of top-level groups.
dart
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();
}