I can't reach model fields on list

Question

Asked by Salih B on November 24, 2021 (source).

I did list data from API. I want use list method on list with dropdownmenu but I can't reach field on list. I want to list my data as price increasing or decreasing. How to I solve to this problem? My list type is RxList.
my list: RxList productList= [].obs;

enter image description here enter image description here

Answer

Question answered by Mojtaba G (source).

Just set type to your RxList when declaring it:

  RxList<YOUR_TYPE> productList = [].obs;

  productController.productList.sort((a,b)=> //do your sort);
API DROP-DOWN-MENU FLUTTER JSON LIST
SHARE: