Closed idesigntrends closed 1 year ago
Hello, can we know the website address?
Hello @idesigntrends,
To fix this error, go to packages/houzi_package/lib/pages/search_result.dart
file, on line 1747
replace code in the if (_currentPropertyListSortValue == 2)
condition with the following code:
if (_currentPropertyListSortValue == 2) {
propertyList.sort((a, b) {
String aPriceStr = a.propertyInfo.price.isNotEmpty ? a.propertyInfo.price : "0";
int aPrice = int.tryParse(aPriceStr.replaceAll(RegExp(r'[^\d]+'), '')) ?? 0;
String bPriceStr = b.propertyInfo.price.isNotEmpty ? b.propertyInfo.price : "0";
int bPrice = int.tryParse(bPriceStr.replaceAll(RegExp(r'[^\d]+'), '')) ?? 0;
return aPrice.compareTo(bPrice);
});
}
Then go to line 1759
and replace code in the if (_currentPropertyListSortValue == 3)
condition with the following code:
if (_currentPropertyListSortValue == 3) {
propertyList.sort((a, b) {
String aPriceStr = a.propertyInfo.price.isNotEmpty ? a.propertyInfo.price : "0";
int aPrice = int.tryParse(aPriceStr.replaceAll(RegExp(r'[^\d]+'), '')) ?? 0;
String bPriceStr = b.propertyInfo.price.isNotEmpty ? b.propertyInfo.price : "0";
int bPrice = int.tryParse(bPriceStr.replaceAll(RegExp(r'[^\d]+'), '')) ?? 0;
return bPrice.compareTo(aPrice);
});
}
it is fixed, thank you.
Marking this as closed.
Hi, The sort by price doesn’t work in the filter. Please help.