apgapg/json_table

Type 'String' is not a subtype of type 'List<dynamic>'

Closed this issue · 2 comments

Hello...thanks for the library!!

But i have a problem with my own json. I pass this json to JsonTable as parameter and i use this columns:

widget.columns = [ JsonTableColumn("titularNombres", label: "Titular Nombre"), JsonTableColumn("titularApellidos", label: "Titular Apellido"), JsonTableColumn("usuarioReserva", label: "Usuario Reserva", defaultValue: "NA"), ];

JSON:

{ "estado": "OK", "razon": "TRANSACCION CORRECTA", "response": { "data": { "consultaReservaResponse": [ { "numeroReserva": 5575, "titularApellidos": "XXXX", "titularNombres": "XXXX", "fechaDesdeReserva": "02-06-2019", "estadoReserva": "R", "paisOrigenTitular": "PARAGUAY", "formaDePago": "EFECTIVO", "fechaHastaReserva": "02-06-2019", "solicitanteReserva": "XXXX", "formaDeReserva": "Via Email", "usuarioReserva": "XXXX", "nroConfirmacionReserva": 5086 }, { "numeroReserva": 5528, "titularApellidos": "XXXX", "titularNombres": "XXXX", "fechaDesdeReserva": "02-06-2019", "estadoReserva": "R", "paisOrigenTitular": "IRLANDA", "formaDePago": "EFECTIVO", "fechaHastaReserva": "12-06-2019", "solicitanteReserva": "XXXX", "formaDeReserva": "Via Email", "usuarioReserva": "XXXXX", "nroConfirmacionReserva": 5041 } ] } }, "token": "XXXXX", "ts": "2019-08-14 13:37:24" }

And i get this error: Type 'String' is not a subtype of type 'List'

Can anyone help me? Thaks!

solved...!
My json has to be like this:
[ { "numeroReserva": 5575, "titularApellidos": "DURE CARDOZO", "titularNombres": "NANCY", "fechaDesdeReserva": "02-06-2019", "estadoReserva": "R", "paisOrigenTitular": "PARAGUAY", "formaDePago": "EFECTIVO", "fechaHastaReserva": "02-06-2019", "solicitanteReserva": "RODRIGO ROJAS", "formaDeReserva": "Via Email", "usuarioReserva": "CGONZALEZ", "nroConfirmacionReserva": 5086 }, { "numeroReserva": 5528, "titularApellidos": "KIRK", "titularNombres": "GLENN", "fechaDesdeReserva": "02-06-2019", "estadoReserva": "R", "paisOrigenTitular": "IRLANDA", "formaDePago": "EFECTIVO", "fechaHastaReserva": "12-06-2019", "solicitanteReserva": "ELENA FORESTI", "formaDeReserva": "Via Email", "usuarioReserva": "WCABAÑAS", "nroConfirmacionReserva": 5041 } ]

Yes, the jsonObject inside jsonArray must be flat. Thanks for using the lib.