Bootstrap

Dart JSON编码器和解码器剖析

 

 

 

 

 

class Owner{
  late String name;
  late String face;
  late int fans;

  Owner.formJson(Map<String,dynamic> json){
    name = json['name'];
    face = json['face'];
    fans = json['fans'];
  }

  // 将mo转成map
  Map<String,dynamic> toJson(){
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['face'] = this.face;
    data['f
;