Skip to content

docs: How can we read textFormField value. #222

Closed
@dhirajReliance

Description

@dhirajReliance

Description

There is no documentation available to read fields value. I did not found the same if documentation is available please share otherwise please guid me how can i read form value.
Here is my json-----

{

"type": "scaffold",
"backgroundColor": "#F4F6FA",
"appBar": {
"type": "appBar",
"backgroundColor": "#00FFFFFF"
},
"body": {
"type": "form",
"id": "login_form",
"child": {
"type": "padding",
"padding": {"left": 24, "right": 24},
"child": {
"type": "column",
"crossAxisAlignment": "start",
"children": [
{
"type": "text",
"data": "Sign in",
"style": {"fontSize": 24, "fontWeight": "w800", "height": 1.3}
},

      {"type": "sizedBox", "height": 24},
      {
        "type": "textFormField",
        "maxLines": 1,
        "id": "email",
        "controller": "emailController",
        "autovalidateMode": "onUserInteraction",
        "validatorRules": [
          {
            "rule": "isEmail",
            "message": "Please enter a valid email"
          }
        ],
        "style": {"fontSize": 16, "fontWeight": "w400", "height": 1.5},
        "decoration": {
          "hintText": "Email",
          "filled": true,
          "fillColor": "#FFFFFF",
          "border": {
            "type": "outlineInputBorder",
            "borderRadius": 8,
            "color": "#24151D29"
          }
        }
      },
      {"type": "sizedBox", "height": 16},
      {
        "type": "textFormField",
        "id": "password",
        "autovalidateMode": "onUserInteraction",
        "validatorRules": [
          {"rule": "isPassword", "message": "Please enter a valid password"}
        ],
        "controller": "passwordController",
        "obscureText": true,
        "maxLines": 1,
        "style": {"fontSize": 16, "fontWeight": "w400", "height": 1.5},
        "decoration": {
          "hintText": "Password",
          "filled": true,
          "fillColor": "#FFFFFF",
          "border": {
            "type": "outlineInputBorder",
            "borderRadius": 8,
            "color": "#24151D29"
          }
        }
      },
      {"type": "sizedBox", "height": 24},

      {
        "type": "filledButton",
        "style": {
          "backgroundColor": "#151D29",
          "shape": {"borderRadius": 8}
        },
        "onPressed": {
          "actionType": "customNavigate",
          "target": "login_screen"
        },
        "child": {
          "type": "padding",
          "padding": {"top": 14, "bottom": 14, "left": 16, "right": 16},
          "child": {
            "type": "row",
            "mainAxisAlignment": "spaceBetween",
            "children": [
              {"type": "text", "data": "Proceed",  "style": {"fontSize": 16, "fontWeight": "w400", "height": 1.5}},
              {
                "type": "icon",
                "iconType": "material",
                "icon": "arrow_forward"
              }
            ]
          }
        }
      },
      {"type": "sizedBox", "height": 16},
      {
        "type": "align",
        "alignment": "center",
        "child": {
          "onPressed": {
            "actionType": "customNavigate",
            "target": "forgot_screen"
          },
          "type": "textButton",

          "child": {
            "type": "text",
            "data": "Forgot password?",
            "style": {
              "fontSize": 15,
              "fontWeight": "w500",
              "color": "#4745B4"
            }
          }
        }
      },
      {"type": "sizedBox", "height": 8},
      {
        "type": "align",
        "alignment": "center",
        "child": {
          "type": "text",
          "data": "Don't have an account? ",
          "style": {
            "fontSize": 15,
            "fontWeight": "w400",
            "color": "#000000"
          },
          "children": [
            {
              "data": "Sign Up for BettrDo",
              "style": {
                "fontSize": 15,
                "fontWeight": "w500",
                "color": "#4745B4"
              }
            }
          ]
        }
      }
    ]
  }
}

}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions