Given the following RFW text:
import core.widgets;
widget root = Row(
children: [
...for city in args.cities:
switch args.showCities {
true: City(),
false: SizedBoxShrink(),
}
]
);
RFW converts this to its internal model, which can be serialized to JSON:
{
"arguments": [],
"widgets": [
"name": "root",
"root": {
"kind": "constructorCall",
"name": "Row",
"arguments": {
"children": [
{
"kind": "loop",
"input": {
"kind": "argsReference",
"parts": ["cities"]
},
"output": {
"kind": "switch",
"input": {
"kind": "argsReference",
"parts": ["showCities"]
},
"outputs": {
"true": {
"kind": "constructorCall",
"name": "City"
},
"false": {
"kind": "constructorCall",
"name": "SizedBoxShrink"
}
}
}
}
]
}
}
]
}