Created
July 9, 2020 14:06
-
-
Save bubnenkoff/eabb9c0fc8c8eb01ffd10827f1a78bbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
main() async { | |
String str = (r"""{ | |
"id": "22657730", | |
"purchaseNumber": "0138200004020000001", | |
"placingWay": "EAP44", | |
"etp_code": "ETP_RTS", | |
"lots": [{ | |
"lot_number": "0", | |
"maxPrice": "1036165", | |
"currency_code": "RUB", | |
"objs": [{ | |
"code": "19.20.21.315", | |
"quantity": "19000", | |
"price": "50.59" | |
}] | |
}, | |
{ | |
"lot_number": "1", | |
"maxPrice": "6115", | |
"currency_code": "RUB", | |
"objs": [{ | |
"code": "42.4115", | |
"quantity": "7113", | |
"price": "22.35" | |
}] | |
} | |
] | |
}"""); | |
Map jsonMapOriginal = jsonDecode(str); | |
List<String> lotsNumberList = []; | |
lotsNumberList = jsonMapOriginal['lots'].map((e)=>e['lot_number'].toString()).toList(); | |
print(lotsNumberList); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment