class ConnectionsModel { String bore_name = ''; String type_of_water=''; String description=''; String source=''; List connections=[]; List inConnections=[]; List outConnections=[]; ConnectionsModel(); factory ConnectionsModel.fromJson(Map json){ ConnectionsModel rtvm = new ConnectionsModel(); rtvm.source = json['boreName'] ?? ''; rtvm.connections = json['typeofwater'] ?? []; return rtvm; } Map toJson() => { "boreName":this.source, "typeofwater": this.connections , }; }