dart jsonDecode与jsonEncode

jsDecode顾名思义是解析json,解析json到模型中,例如将字符串json pt解析到实体类payloadModel中:

  final payloadModel = PayLoadModel.fromJson(jsonDecode(pt) as Map);
jsonEncode是把数据转为json

你可能感兴趣的:(Flutter)