Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dart:convert';
- void main() {
- String jsonString = '''
- {
- ModuleEId: [
- [
- "Test Equipment - R&D",
- "GPU_0001_180 KVA Dual AC 28.5V DC"
- ],
- [
- "Test Equipment - Electronics",
- "GPU_0004_180 KVA Dual AC 28.5 V DC"
- ]
- ]
- }
- ''';
- // fix json format
- jsonString = jsonString.replaceAll('ModuleEId', '"ModuleEId"');
- // parse json
- final parsed = json.decode(jsonString);
- print("Parsed: $parsed \n");
- // iterate through array and print elements
- for (final a in parsed['ModuleEId']) {
- for (final b in a) {
- print(b);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement