Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "type": "scaffold",
- "appBar": {
- "type": "appBar",
- "title": { "type": "text", "data": "Validated Form" },
- "backgroundColor": "#4D00E9"
- },
- "body": {
- "type": "form",
- "child": {
- "type": "singleChildScrollView",
- "child": {
- "type": "container",
- "padding": { "left": 12, "right": 12, "top": 12, "bottom": 12 },
- "child": {
- "type": "column",
- "children": [
- { "type": "sizedBox", "height": 16 },
- {
- "type": "festivalMenuGrid",
- "grid": {
- "columns": 3,
- "crossAxisSpacing": 12,
- "mainAxisSpacing": 12,
- "childAspectRatio": 0.85
- },
- "theme": {
- "backgroundColor": "#FFFDF7","backgroundImage": "https://picsum.photos/500/800",
- "sourceType": "network",
- "header": {
- "title": "Study Resources",
- "subtitle": "Select a category to explore material"
- },
- "card": {
- "backgroundColor": "#FFFFFF",
- "borderRadius": 12,
- "borderColor": "#E0E0E0",
- "selectedBorderColor": "#FF7A00",
- "selectedBorderWidth": 2.5,
- "shadow": true,
- "bottomWave": {
- "enabled": true,
- "colors": ["#FF9933", "#FFFFFF", "#128807"]
- }
- }
- },
- "items": [
- {
- "id": "syllabus",
- "title": "Syllabus",
- "icon": "https://joshappfeeds.jagranjosh.com/jagran_josh_app/icons/govt_jobs.svg",
- "selected": true,
- "route": "/syllabus"
- },
- {
- "id": "deleted_syllabus",
- "title": "Deleted\nSyllabus",
- "icon": "https://joshappfeeds.jagranjosh.com/jagran_josh_app/icons/govt_jobs.svg",
- "selected": false,
- "route": "/deleted-syllabus"
- },
- {
- "id": "study_material",
- "title": "Study Material",
- "icon": "https://joshappfeeds.jagranjosh.com/jagran_josh_app/icons/govt_jobs.svg",
- "selected": false,
- "route": "/study-material"
- },
- {
- "id": "ncert_books",
- "title": "Ncert Books",
- "icon": "https://joshappfeeds.jagranjosh.com/jagran_josh_app/icons/govt_jobs.svg",
- "selected": false,
- "route": "/ncert-books"
- },
- {
- "id": "ncert_exemplers",
- "title": "Ncert\nExemplers",
- "icon": "https://joshappfeeds.jagranjosh.com/jagran_josh_app/icons/govt_jobs.svg",
- "selected": false,
- "route": "/ncert-exemplers"
- },
- {
- "id": "important_questions",
- "title": "Important\nQuestions",
- "icon": "https://joshappfeeds.jagranjosh.com/jagran_josh_app/icons/engineer_new.svg",
- "selected": false,
- "route": "/important-questions"
- }
- ]
- },
- {
- "type": "singleChildScrollView",
- "child": {
- "type": "container",
- "padding": {
- "left": 16,
- "right": 16,
- "top": 16,
- "bottom": 16
- },
- "child": {
- "type": "gridView",
- "crossAxisCount": 3,
- "mainAxisSpacing": 12,
- "crossAxisSpacing": 12,
- "childAspectRatio": 0.8,
- "shrinkWrap": true,
- "children": [
- {
- "type": "container",
- "decoration": {
- "color": "#FFFFFF",
- "borderRadius": 12,
- "border": {
- "color": "#4CAF50",
- "width": 1.5
- },
- "boxShadow": [
- {
- "color": "#1A000000",
- "blurRadius": 6,
- "offset": { "dx": 0, "dy": 2 }
- }
- ]
- },
- "child": {
- "type": "column",
- "mainAxisAlignment": "center",
- "children": [
- {
- "type": "svg",
- "sourceType": "network",
- "src": "https://joshappfeeds.jagranjosh.com/jagran_josh_app/icons/govt_jobs.svg",
- "width": 50,
- "height": 50
- },
- { "type": "sizedBox", "height": 8 },
- {
- "type": "text",
- "data": "Syllabus",
- "style": {
- "fontSize": 13,
- "fontWeight": "bold",
- "color": "#1F2937"
- }
- }
- ]
- }
- },
- {
- "type": "container",
- "decoration": {
- "color": "#FFFFFF",
- "borderRadius": 12,
- "border": {
- "color": "#4CAF50",
- "width": 1.5
- },
- "boxShadow": [
- {
- "color": "#1A000000",
- "blurRadius": 6,
- "offset": { "dx": 0, "dy": 2 }
- }
- ]
- },
- "child": {
- "type": "column",
- "mainAxisAlignment": "center",
- "children": [
- {
- "type": "svg",
- "src": "https://joshappfeeds.jagranjosh.com/jagran_josh_app/icons/engineer_new.svg",
- "width": 50,
- "height": 50
- },
- { "type": "sizedBox", "height": 8 },
- {
- "type": "text",
- "data": "Deleted\nSyllabus",
- "textAlign": "center",
- "style": {
- "fontSize": 13,
- "fontWeight": "bold",
- "color": "#1F2937"
- }
- }
- ]
- }
- },
- {
- "type": "container",
- "decoration": {
- "color": "#FFFFFF",
- "borderRadius": 12,
- "border": {
- "color": "#4CAF50",
- "width": 1.5
- },
- "boxShadow": [
- {
- "color": "#1A000000",
- "blurRadius": 6,
- "offset": { "dx": 0, "dy": 2 }
- }
- ]
- },
- "child": {
- "type": "column",
- "mainAxisAlignment": "center",
- "children": [
- {
- "type": "svg",
- "src": "https://joshappfeeds.jagranjosh.com/jagran_josh_app/icons/engineer_new.svg",
- "width": 50,
- "height": 50
- },
- { "type": "sizedBox", "height": 8 },
- {
- "type": "text",
- "data": "Important\nQuestions",
- "textAlign": "center",
- "style": {
- "fontSize": 13,
- "fontWeight": "bold",
- "color": "#1F2937"
- }
- }
- ]
- }
- }
- ]
- }
- }
- },
- {
- "type": "textFormField",
- "id": "name",
- "decoration": {
- "labelText": "Name*",
- "filled": true,
- "fillColor": "#F2F2F2"
- },
- "validatorRules": [
- {
- "rule": "isLength",
- "options": { "min": 2 },
- "message": "Name must be at least 2 characters long"
- }
- ]
- },
- { "type": "sizedBox", "height": 16 },
- {
- "type": "textFormField",
- "id": "phone",
- "keyboardType": "phone",
- "decoration": {
- "labelText": "Phone number*",
- "filled": true,
- "fillColor": "#F2F2F2"
- },
- "validatorRules": [
- {
- "rule": "matches",
- "options": { "pattern": "^[0-9]{10}$" },
- "message": "Enter a valid 10-digit phone number"
- }
- ]
- },
- { "type": "sizedBox", "height": 16 },
- {
- "type": "textFormField",
- "id": "email",
- "keyboardType": "emailAddress",
- "decoration": {
- "labelText": "Email*",
- "filled": true,
- "fillColor": "#F2F2F2"
- },
- "validatorRules": [
- {
- "rule": "matches",
- "options": {
- "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
- },
- "message": "Enter a valid email address"
- }
- ]
- },
- { "type": "sizedBox", "height": 16 },
- {
- "type": "textFormField",
- "id": "password",
- "obscureText": true,
- "decoration": {
- "labelText": "Password*",
- "filled": true,
- "fillColor": "#F2F2F2"
- },
- "validatorRules": [
- {
- "rule": "isLength",
- "options": { "min": 6 },
- "message": "Password must be at least 6 characters"
- }
- ]
- },
- { "type": "sizedBox", "height": 16 },
- {
- "type": "textFormField",
- "id": "confirm_password",
- "obscureText": true,
- "decoration": {
- "labelText": "Re-type password*",
- "filled": true,
- "fillColor": "#F2F2F2"
- },
- "validatorRules": [
- {
- "rule": "compare",
- "options": { "fieldId": "password" },
- "message": "Passwords do not match"
- }
- ]
- },
- { "type": "sizedBox", "height": 24 },
- {
- "type": "elevatedButton",
- "child": { "type": "text", "data": "Submit" },
- "style": { "backgroundColor": "#4D00E9" },
- "onPressed": {
- "actionType": "validateForm"
- }},
- {
- "type": "listTile",
- "title": { "type": "text", "data": "John Doe" },
- "subtitle": { "type": "text", "data": "[email protected]" },
- "leading": {
- "type": "icon",
- "iconType": "material",
- "icon": "person"
- }
- },
- {
- "type": "listTile",
- "title": { "type": "text", "data": "Jane Smith" },
- "subtitle": { "type": "text", "data": "[email protected]" },
- "leading": {
- "type": "icon",
- "iconType": "material",
- "icon": "person"
- }
- }]
- }
- }
- }}}
Advertisement
Add Comment
Please, Sign In to add comment