searchProducts method
Products search by product name.
Use limit and offset to paginate the result.
Valid values for sortType are: 'asc' and 'desc'
Implementation
Future<List<ProductInfo>> searchProducts({
required String searchText,
int? limit,
int offset = 0,
int? productType,
String? sortColumn,
String? sortType,
}) async {
final result = await _repository.searchProductsRequest(
sessionId,
accountInfo.intAccount,
searchText,
limit,
offset,
productType ?? invalidIntValue,
sortColumn,
sortType,
);
List<ProductInfo> products = [];
result.when(
(data) {
products = data;
},
(error) => throw error..methodName = 'searchProducts',
);
return products;
}