且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法将数据存储在列表中

更新时间:2023-01-12 11:12:20

如果查看jsonData,您可能会注意到某些字段不是String而是int 你的模型课应该是这样的

if you look into jsonData you could notice some fields NOT a Strings but int you model class should be like this

class userData {
  final int pid;
  final String name;
  final String description;
  final int status;
  final String tokenName;
  final String updatedAt;
  final int tokenNumber;

  userData(this.pid, this.name, this.description, this.status, this.tokenName, this.updatedAt, this.tokenNumber);
}

如果按约定重命名此类-UserData

also will be much better if you rename this class by convention - UserData