Flutter开发之——网络请求-手动json数据解析,轻松拿下offer

本文介绍了在Flutter中进行网络请求和手动JSON数据解析的方法,包括不返回结果的请求、返回Article对象的请求,以及如何将请求结果赋值给Article类。通过示例展示了如何使用HttpClient发送HTTP请求,然后解析JSON数据到自定义的Article和Tag类。最后,利用FutureBuilder展示网络请求后的数据。
摘要由CSDN通过智能技术生成

personList.add(Person.fromJson(map));

}

ArticleData(

curPage = json[‘curPage’],

offset = json[‘curPage’],

over = json[‘over’],

pageCount = json[‘pageCount’],

size = json[‘size’],

total = json[‘total’],

datas = personList);

}

}

class Person {

String apkLink;

int audit;

String author;

bool canEdit;

int chapterId;

String chapterName;

bool collect;

int courseId;

String desc;

String descMd;

String envelopePic;

bool fresh;

String host;

int id;

String link;

String niceDate;

String niceShareDate;

String origin;

String prefix;

String projectLink;

int publishTime;

int realSuperChapterId;

int selfVisible;

int shareDate;

String shareUser;

int superChapterId;

String superChapterName;

List tags;

String title;

int type;

int userId;

int visible;

int zan;

Person(

this.apkLink,

this.audit,

this.author,

this.canEdit,

this.chapterId,

this.chapterName,

this.collect,

this.courseId,

this.desc,

this.descMd,

this.envelo

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值