feat: Implement agent filtering by integrating a new API endpoint for filterable fields, introducing filter data models, and adding a dedicated filter sheet UI, alongside an updated profile icon.

This commit is contained in:
pradeepkumar
2026-03-07 22:33:09 +05:30
parent 402c1cf206
commit ef0fe593ab
7 changed files with 568 additions and 19 deletions

View File

@@ -0,0 +1,39 @@
class FilterOption {
final String value;
final String label;
const FilterOption({required this.value, required this.label});
factory FilterOption.fromJson(Map<String, dynamic> json) {
return FilterOption(
value: json['value'] as String? ?? '',
label: json['label'] as String? ?? '',
);
}
}
class FilterableField {
final String slug;
final String name;
final String fieldType;
final List<FilterOption> options;
const FilterableField({
required this.slug,
required this.name,
required this.fieldType,
this.options = const [],
});
factory FilterableField.fromJson(Map<String, dynamic> json) {
return FilterableField(
slug: json['slug'] as String? ?? '',
name: json['name'] as String? ?? '',
fieldType: json['fieldType'] as String? ?? '',
options: (json['options'] as List<dynamic>?)
?.map((e) => FilterOption.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
);
}
}