【发布时间】:2021-11-18 19:42:44
【问题描述】:
我有一个List<Contact>,其中的类联系人如下所示:
class Contact {
Contact({
this.id,
this.name,
this.phone,
this.job,
this.company,
this.image,
this.email,
});
int? id;
String? name;
String? phone;
String? job;
String? company;
String? image;
String? email;
}
问题是,如何通过比较 Contact.name 对 List 进行排序? 因为我想按 A-Z 升序对列表进行排序
【问题讨论】:
标签: list flutter class sorting dart