Как сделать динамическую страницу, прочитав файл Json из / asset / location - PullRequest
0 голосов
/ 07 ноября 2019

Ниже мое JSON struture и из него нужно построить страницу

{
    "error": "ERROR CODE",
    (note: thiswillonlybepresentifanerroroccurs)"type": "native_ui",
    "components": [
    {
        " pageHeader": "header",
        " elements": [
        {
            "type ": "header",
            "content ": "header text"
        },
        {
            "type ": "text",
            "content ": "text"
        },
        {
            "type ": "edittext",
            "value ": "default text",
            "inputType ": "number"/"text"/"email"/"tel"/"password",
            "id": "componentID"
        },
        {
            "type ": "checkbox",
            "label ": "text",
            "value ": true/false,
            "id": "componentID"
        },
        {
            "type ": "horizontal_rule"
        },
        {
            "type ": "line_break"
        },
        {
            "type ": "buttonDialog",
            "buttonText ": "button text""header ": "header text",
            "content ": "dialog text",
            "positiveButton": "button text",
            "negativeButton": "button text"/null
        },
        {
            "type ": "radio_group",
            "header ": "header text",
            "items ": [
            "item1",
            "item2",
            "item3",
            "item4",
            &
            ],
            "value": 1,
            "id": "componentID"
        },
        {
            "type ": "picker",
            "header ": "header text",
            "items ": [
            "item1",
            "item2",
            "item3",
            "item4",
            &
            ],
            "value": 1,
            "id": "componentID"
        },
        {
            "type ": "linkDialog",
            "link ": "link text""header ": "header text",
            "content ": "dialog text",
            "positiveButton": "button text",
            "negativeButton": "button text"/null
        },
        {
            "type ": "navButton",
            "pageIndex ": 1"content ": "button text",

        }
        ]
    }
    ]
}
...