fetch_json_pages 0.0.2 copy "fetch_json_pages: ^0.0.2" to clipboard
fetch_json_pages: ^0.0.2 copied to clipboard

Using this package you can directly render page which uses json_dynamic_widget

This version is supported for new version Using this package you can directly render page using navigator.push , as input you have to pass json string as shown in the below example

##Example

String screen =
              await rootBundle.loadString('assets/json/screen.json');

navigatorKey.currentState?.push(MaterialPageRoute(
            builder: (context) =>
                renderingPage(jsonString: screen),
          ));
<!-- assets/json/screen.json -->

{
    "type": "scaffold",
    "args": {
        "appBar": {
            "type": "app_bar",
            "args": {
                "title": {
                    "type": "text",
                    "args": {
                        "text": "Sign Up",
                        "style": {
                            "color": "#000000",
                            "fontWeight": "bold"
                        }
                    }
                },
                "backgroundColor": "#1569C7"
            }
        },
        "body": {
            "type": "single_child_scroll_view",
            "args": {
                "child": {
                    "type": "column",
                    "args": {
                        "children": [


                            {
                                "type": "container",
                                "args": {
                                    "padding": [
                                        20,
                                        20,
                                        20,
                                        20
                                    ],
                                    "child": {
                                        "type": "safe_area",
                                        "args": {
                                            "child": {
                                                "type": "form",
                                                "args": {
                                                    "child": {
                                                        "type": "column",
                                                        "args": {
                                                            "crossAxisAlignment": "center",
                                                            "mainAxisAlignment": "center",
                                                            "children": [
                                                                {
                                                                    "type": "row",
                                                                    "args": {
                                                                        "children": [
                                                                            {
                                                                                "type": "asset_image",
                                                                                "args": {
                                                                                    "height": 30,
                                                                                    "width": 30,
                                                                                    "name": "assets/images/Prefix_mobile.png"
                                                                                }
                                                                            },
                                                                            {
                                                                                "type": "sized_box",
                                                                                "args": {
                                                                                    "width": 10
                                                                                }
                                                                            },
                                                                            {
                                                                                "type": "expanded",
                                                                                "args": {
                                                                                    "child": {
                                                                                        "type": "stack",
                                                                                        "args": {
                                                                                            "children": [
                                                                                                {
                                                                                                    "type": "text_form_field",
                                                                                                    "id": "password",
                                                                                                    "args": {
                                                                                                        "keyboardType": "number",
                                                                                                        "controller": "${text1FieldController}",
                                                                                                        "obscureText": "true",
                                                                                                        "decoration": {
                                                                                                            "labelText": "Enter your PIN",
                                                                                                            "labelStyle": {
                                                                                                                "color": "#1569C7",
                                                                                                                "fontWeight": "bold",
                                                                                                                "fontSize": 15
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "type": "positioned",
                                                                                                    "args": {
                                                                                                        "right": 0,
                                                                                                        "bottom": 10,
                                                                                                        "child": {
                                                                                                            "type": "row",
                                                                                                            "args": {
                                                                                                                "mainAxisSize": "min",
                                                                                                                "children": [
                                                                                                                    {
                                                                                                                        "type": "asset_image",
                                                                                                                        "args": {
                                                                                                                            "height": 30,
                                                                                                                            "width": 30,
                                                                                                                            "name": "assets/images/eyeon.png"
                                                                                                                        }
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        ]
                                                                    }
                                                                },
                                                                {
                                                                    "type": "sized_box",
                                                                    "args": {
                                                                        "height": 40
                                                                    }
                                                                },
                                                                {
                                                                    "type": "elevated_button",
                                                                    "args": {
                                                                        "child": {
                                                                            "type": "text",
                                                                            "args": {
                                                                                "text": "Login",
                                                                                "style": {
                                                                                    "color": "#FFFFFF"
                                                                                }
                                                                            }
                                                                        },
                                                                        "style": {
                                                                            "backgroundColor": "#1569C7"
                                                                        },
                                                                        "onPressed": "${pin('form_context')}"
                                                                    }
                                                                }
                                                            ]
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        }
    }
}
1
likes
130
points
13
downloads

Publisher

unverified uploader

Weekly Downloads

Using this package you can directly render page which uses json_dynamic_widget

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, json_dynamic_widget

More

Packages that depend on fetch_json_pages