[英]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.