Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Mirai Network Request & Network Result #267

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

divyanshub024
Copy link
Contributor

Description

This PR adds a better and new way for network calls. It also allows users to perform actions from the network call.

            "onPressed": {
              "actionType": "networkRequest",
              "url": "https://demo-identity.securrency.com/connect/token",
              "method": "post",
              "contentType": "application/x-www-form-urlencoded",
              "body": {
                "username": {
                  "actionType": "getFormDataValue",
                  "id": "email"
                },
                "password": {
                  "actionType": "getFormDataValue",
                  "id": "password"
                },
                "client_id": "mobile",
                "scope": "openid email roles profile identity.public identity.admin entity securrency.finance securrency.exchange securrency.ens",
                "grant_type": "mobile"
              },
              "results": [
                {
                  "statusCode": 200,
                  "action": {
                    "actionType": "navigate",
                    "navigationStyle": "pushReplacement",
                    "assetPath": "assets/json/user_profile_screen.json"
                  }
                },
                {
                  "statusCode": 400,
                  "action": {
                    "actionType": "showDialog",
                    "widget": {
                      "type": "alertDialog",
                      "titlePadding": {
                        "top": 8,
                        "left": 12,
                        "right": 12
                      },
                      "contentPadding": {
                        "top": 8,
                        "left": 12,
                        "right": 12
                      },
                      "title": {
                        "type": "text",
                        "data": "Failed to SignIn",
                        "align": "center",
                        "style": {
                          "fontSize": 21
                        }
                      },
                      "content": {
                        "type": "text",
                        "data": "Invalid username or password.",
                        "align": "center",
                        "style": {
                          "fontSize": 14
                        }
                      },
                      "actions": [
                        {
                          "type": "textButton",
                          "child": {
                            "type": "text",
                            "data": "OK"
                          },
                          "onPressed": {
                            "actionType": "navigate",
                            "navigationStyle": "pop"
                          }
                        },
                        {
                          "type": "sizedBox",
                          "width": 12
                        }
                      ]
                    }
                  }
                }
 

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Code refactor
  • Build configuration change
  • Documentation
  • Chore

@divyanshub024 divyanshub024 added this to the v0.7 milestone Feb 26, 2024
@divyanshub024 divyanshub024 merged commit 4a6ae1b into main Feb 26, 2024
3 checks passed
@divyanshub024 divyanshub024 deleted the dv/network-request branch February 26, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant