简体   繁体   English

Flutter - 似乎无法订购列表,我不知道为什么

[英]Flutter - Can't seem to order a list and i've no clue why

I have a model which defines some JSON from an Api.我有一个模型,它从 Api 定义了一些 JSON。

abstract class ITrainingExerciseListingProvider with Store {
  @observable
  List exerciseList = [];

  @observable
  List<ExerciseModel> exerciseModelList = [];

您不能根据模型类对列表进行排序,但必须根据模型假设名称或任何其他字段的 val 对列表进行排序。

"

Did you try this?你试过这个吗?

exerciseList.sort((o1, o2) {
                // handle the sort logic here
                return 1;
              });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我不能创建 flutter<dart> 动态类别列表?</dart> - Why can't I create flutter <dart> dynamic category list? 我似乎无法在我的轮播小部件中显示我的 JSON 数据图像。 (扑) - I can't seem to display my JSON data image in my carousel widget. (Flutter) 似乎无法弄清楚为什么我无法将JSON读取到DataFrame中 - Can't seem to figure out why I can't read JSON into DataFrame 我需要遍历JSON数组-不确定如何执行-已搜索但仍然无法获得线索 - I need to iterate over a JSON array - not sure how to do it - have searched but still can't get a clue 为什么我无法向 Zoho Sales Order API 提交记录? - Why can't I submit a record to Zoho Sales Order API? 不知道为什么代码没有导致响应,总是失败 - No clue why doesn't the code lead to a response, always fails 为什么我不能从 json - flutter 获取数据值 - Why can't i get data value from json - flutter Rails:NoMethodError(_controller的未定义方法_url。我在创建之后似乎无法正确响应json。为什么? - Rails: NoMethodError (Undefined method _url for _controller. I can't seem to respond_with json properly after my create. Why? 我似乎无法访问swiftyJSON中的子数组 - I can't seem to access sub arrays in swiftyJSON IISNode缓存旧文件名,我似乎无法更新它 - IISNode caching old file names and I can't seem to update it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM