class CertificateModel { final String? idPayment; final String? name; final String? title; final int? finishDate; final String? certificateNo; CertificateModel({ this.idPayment, this.name, this.title, this.finishDate, required this.certificateNo, }); factory CertificateModel.fromJson(Map json) => CertificateModel( name: json['name'], title: json['title'], finishDate: json['finish_date'], certificateNo: json['certificate_no'], idPayment: json['id_enrol'], ); Map toJson() => { 'id_enrol': idPayment, 'name': name, 'title': title, 'finishDate': finishDate, 'certificate_no': certificateNo, }; } class CertificateNo { CertificateNo({ this.idPayment, }); String? idPayment; factory CertificateNo.fromJson(Map json) => CertificateNo( idPayment: json["id_payment"], ); Map toJson() => { "id_payment": idPayment, }; }