【发布时间】:2021-09-25 22:58:58
【问题描述】:
IN this you can find the error when json is converted当我使用 https://javiercbk.github.io/json_to_dart/ 将下面的 json 转换为 dart 时,它说“生成的 Dart 代码无效”。我正在使用未来的构建器在用户界面中显示响应。 当我注释掉“状态”类时,错误发生但没有显示响应。
{
"result": {
"userDetails": {
"digilockerid": "...digilockerid...",
"name": "...name...",
"dob": "...dob...",
"gender": "...M/F/T...",
"eaadhaar": "...Y or N as per availability..."
},
"files": [{
"name": "Aadhaar Card",
"type": "file",
"size": "",
"date": "...date...",
"parent": "",
"mime": [
"application/pdf",
"application/xml",
"application/json"
],
"doctype": "...5 letter DOC key...",
"description": "...Description...",
"issuerid": "...issuer id...",
"issuer": "...issuer name...",
"id": "...unique file ID..."
}],
"eAadhaar": {
"name": "...name...",
"dob": "...date of birth...",
"uid":"...uid...",
"gender": "...gender...",
"x509Data": {
"validAadhaarDSC": "...is eaadhaar certificate valid or not (yes/no)..."
},
"address": "...address",
"photo": "...link to photo as on eaadhaar...",
"splitAddress": {
"district": [
"...district name..."
],
"state": [
[
"...state name...",
"...2 digit state code..."
]
],
"city": [
"...city name..."
],
"pincode": "...pincode...",
"country": [
"...2 digit ISO country name...",
"...3 digit ISO country name...",
"...country name..."
],
"addressLine": "...address..."
}
}
}
}
【问题讨论】:
-
您使用的是空安全吗?
-
noo ,这与空安全无关。在线将json转换为对象时会出现此问题
标签: json flutter dart flutter-dependencies