Filtering
A dataset owns one active filtered view. The same filter API works for local datasets and adapter-backed paged datasets; supported adapter predicates are translated into query criteria by the adapter path.
Direct filter descriptors
Use filter.set() when filters are assembled dynamically or already represented as data:
await dataSet.filter.set([
const FdcDataSetFilter(
fieldName: 'status',
operator: FdcFilterOperator.equals,
value: 'active',
),
]);
Replace the entire public filter set by calling set() again.
Clear public field and selection filters with:
await dataSet.filter.clear();
Fluent filter expressions
For compact code, build an AND-only expression and apply it once:
await dataSet.filter
.where('status').equals('active')
.and('amount').greaterThan(100)
.apply();
Filtering and ordering can also be applied in one expression:
await dataSet.filter
.where('status').equals('active')
.orderBy('name').ascending
.apply();
Filter conditions must be declared before orderBy().
Inspect active filters
final active = dataSet.filter.active;
final filters = dataSet.filter.items;
final context = dataSet.filter.context;
items contains field-level descriptors. Non-field filter state is exposed through the filter context.
Local and paged behavior
For local data, filtering rebuilds the in-memory view. For adapter-backed paging, supported predicates are sent through the adapter query path so filtering applies to the logical result set rather than only the currently loaded page.
Adapter capabilities can differ by operator. Check the relevant adapter guide before relying on specialized operators in a paged query.