mirrored_repositories/Flutter-Visual-Programing
import 'package:flutter/material.dart';
import 'package:flutter_iconpicker/IconPicker/icons.dart';
import 'package:uuid/uuid.dart';
import 'package:smart_dropdown/smart_dropdown.dart';
import 'node.dart';

Node node(String name, int varid, Offset pos, int classId) {
  if (name == "Screen") {
    return Node(
      isItCalss: true,
      size: Size(200, 120),
      type: "Screen",
      id: Uuid().v1(),
      title: "Screen",
      varName: "myClass",
      x: pos.dx,
      y: pos.dy,
      classId: varid,
      inputs: [
        {
          'show': false,
          "HaveMax": false,
          "name": "StatefulWidget",
          'id': Uuid().v1(),
          'LineDx': 0,
          'LineDy': 0,
          'valueType': 'widget',
          'value': "Text",
          "canSetFromNode": false,
          "isConected": false,
          "haveTextFiled": false,
          "fromVar": false,
          "varId": null,
          'FromId': null,
        },
        {
          "HaveMax": false,
          "varId": null,
          "name": "Widget",
          'id': Uuid().v1(),
          'LineDx': 0,
          'LineDy': 0,
          'valueType': 'Widget',
          "fromVar": false,
          'value': null,
          "isConected": false,
          "haveTextFiled": false,
          'targetId': null,
          'targetNode': null,
          "canSetFromNode": true,
          "child": null,
          'FromId': null,
        },
      ],
      outputs: [
        {
          'targetId': null,
          "name": "Class",
          'id': Uuid().v1(),
          'LineDx': 0,
          'LineDy': 0,
          'valueType': 'Class',
          'value': "class",
          'targetNode': null,
          'targetInputInedx': null,
        },
      ],
    );
  } else if (name == "Scaffold") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        type: "Scaffold",
        size: Size(200, 330),
        id: Uuid().v1(),
        title: "Scaffold",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            "body": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            "fromVar": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "child": null,
            "name": "body",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "BackGround Color",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': Color.fromARGB(255, 255, 255, 255),
            "isConected": false,
            "haveTextFiled": true,
            "fromVar": false,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "fromVar": false,
            "child": null,
            "name": "AppBar",
            'FromId': null,
          },
          {
            "HaveMax": true,
            "name": "AppBarHeight",
            "max": false,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'value': 60,
            "isConected": false,
            "haveTextFiled": true,
            "fromVar": false,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            "Drawer": "Drawer",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "fromVar": false,
            "child": null,
            "name": "Drawer",
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': "class",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Container") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        type: "Container",
        size: Size(200, 280),
        id: Uuid().v1(),
        title: "Container",
        inputs: [
          {
            "HaveMax": true,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'value': 100,
            "max": false,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Height",
            "fromVar": false,
            'FromId': null,
          },
          {
            "HaveMax": true,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'value': 100,
            "max": false,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "fromVar": false,
            "name": "Width",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "Color",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': Color.fromARGB(255, 0, 149, 255),
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "fromVar": false,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "child": null,
            "name": "Child",
            "fromVar": false,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': "class",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Nav") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        type: "Nav",
        size: Size(150, 148),
        id: Uuid().v1(),
        title: "Nav",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Class',
            'value': 100,
            "max": false,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "To",
            "fromVar": false,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Function",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "AppBar") {
    return Node(
        size: Size(200, 300),
        x: pos.dx,
        y: pos.dy,
        type: "AppBar",
        id: Uuid().v1(),
        title: "AppBar",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Title",
            "fromVar": false,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "Color",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': Color.fromARGB(255, 255, 255, 255),
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "fromVar": false,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "FlexibleSpace",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            "fromVar": false,
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "ShadowColor",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': Color.fromARGB(255, 255, 255, 255),
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "fromVar": false,
            "varId": null,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': AppBar(),
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Image") {
    return Node(
        size: Size(200, 280),
        x: pos.dx,
        y: pos.dy,
        type: "Image",
        id: Uuid().v1(),
        title: "Image",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'String',
            'value': "https://i.postimg.cc/FKJ3wv68/Cover-1-1.png",
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Link",
            "fromVar": false,
            'FromId': null,
          },
          {
            "HaveMax": true,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'value': 100,
            "max": false,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Height",
            "fromVar": false,
            'FromId': null,
          },
          {
            "HaveMax": true,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'value': 100,
            "max": false,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "fromVar": false,
            "name": "Width",
            'FromId': null,
          },
          {
            "haveDropDown": true,
            "DropDownList": <SmartDropdownMenuItem<dynamic>>[
              dropdownMenuItem(BoxFit.contain, "Contain"),
              dropdownMenuItem(BoxFit.cover, "Cover"),
              dropdownMenuItem(BoxFit.fill, "Fill"),
              dropdownMenuItem(BoxFit.fitHeight, "FitHeight"),
              dropdownMenuItem(BoxFit.fitWidth, "FitWidth"),
              dropdownMenuItem(BoxFit.scaleDown, "ScaleDown"),
            ],
            "HaveMax": false,
            "name": "Fit",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': BoxFit.contain,
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": false,
            "fromVar": false,
            "varId": null,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': AppBar(),
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "SizedBox") {
    return Node(
        size: Size(200, 220),
        x: pos.dx,
        y: pos.dy,
        type: "SizedBox",
        id: Uuid().v1(),
        title: "SizedBox",
        inputs: [
          {
            "HaveMax": true,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'value': 100,
            "max": false,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Height",
            "fromVar": false,
            'FromId': null,
          },
          {
            "HaveMax": true,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'value': 100,
            "max": false,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "fromVar": false,
            "name": "Width",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Child",
            "fromVar": false,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': AppBar(),
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Center") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        type: "Center",
        id: Uuid().v1(),
        title: "Center",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Child",
            "fromVar": false,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': "cla",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Icon") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        type: "Icon",
        size: Size(200, 250),
        id: Uuid().v1(),
        title: "Icon",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'IconData',
            'value': Icons.abc,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Icon",
            "fromVar": false,
            'FromId': null,
          },
          {
            "HaveMax": true,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'value': 40,
            "max": false,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Height",
            "fromVar": false,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "Color",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': Color.fromARGB(255, 0, 153, 255),
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "fromVar": false,
            "varId": null,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': "cla",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Row") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        type: "Row",
        size: Size(230, 200),
        id: Uuid().v1(),
        title: "Row",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': <Node>[],
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Children",
            "fromVar": false,
            'FromId': null,
          },
          {
            "haveDropDown": true,
            "DropDownList": <SmartDropdownMenuItem<dynamic>>[
              dropdownMenuItem(MainAxisAlignment.start, "Start"),
              dropdownMenuItem(MainAxisAlignment.center, "Center"),
              dropdownMenuItem(MainAxisAlignment.end, "End"),
              dropdownMenuItem(MainAxisAlignment.spaceAround, "SpaceAround"),
              dropdownMenuItem(MainAxisAlignment.spaceBetween, "SpaceBetween"),
              dropdownMenuItem(MainAxisAlignment.spaceEvenly, "SpaceEvenly"),
            ],
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': MainAxisAlignment.start,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": false,
            "name": "MainAxisAlignment",
            "fromVar": false,
            'FromId': null,
          },
          {
            "haveDropDown": true,
            "DropDownList": <SmartDropdownMenuItem<dynamic>>[
              dropdownMenuItem(CrossAxisAlignment.start, "Start"),
              dropdownMenuItem(CrossAxisAlignment.center, "Center"),
              dropdownMenuItem(CrossAxisAlignment.end, "End"),
              dropdownMenuItem(CrossAxisAlignment.baseline, "Baseline"),
              dropdownMenuItem(CrossAxisAlignment.stretch, "Stretch"),
            ],
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': CrossAxisAlignment.start,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": false,
            "name": "CrossAxisAlignment",
            "fromVar": false,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': 'clas',
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Column") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        type: "Column",
        size: Size(230, 200),
        id: Uuid().v1(),
        title: "Column",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': <Node>[],
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Children",
            "fromVar": false,
            'FromId': null,
          },
          {
            "haveDropDown": true,
            "DropDownList": <SmartDropdownMenuItem<dynamic>>[
              dropdownMenuItem(MainAxisAlignment.start, "Start"),
              dropdownMenuItem(MainAxisAlignment.center, "Center"),
              dropdownMenuItem(MainAxisAlignment.end, "End"),
              dropdownMenuItem(MainAxisAlignment.spaceAround, "SpaceAround"),
              dropdownMenuItem(MainAxisAlignment.spaceBetween, "SpaceBetween"),
              dropdownMenuItem(MainAxisAlignment.spaceEvenly, "SpaceEvenly"),
            ],
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': MainAxisAlignment.start,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": false,
            "name": "MainAxisAlignment",
            "fromVar": false,
            'FromId': null,
          },
          {
            "haveDropDown": true,
            "DropDownList": <SmartDropdownMenuItem<dynamic>>[
              dropdownMenuItem(CrossAxisAlignment.start, "Start"),
              dropdownMenuItem(CrossAxisAlignment.center, "Center"),
              dropdownMenuItem(CrossAxisAlignment.end, "End"),
              dropdownMenuItem(CrossAxisAlignment.baseline, "Baseline"),
              dropdownMenuItem(CrossAxisAlignment.stretch, "Stretch"),
            ],
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': CrossAxisAlignment.start,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": false,
            "name": "CrossAxisAlignment",
            "fromVar": false,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': 'clas',
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Stack") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        type: "Stack",
        size: Size(230, 200),
        id: Uuid().v1(),
        title: "Stack",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': <Node>[],
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Children",
            "fromVar": false,
            'FromId': null,
          },
          {
            "haveDropDown": true,
            "DropDownList": <SmartDropdownMenuItem<dynamic>>[
              dropdownMenuItem(AlignmentDirectional.topStart, "TopStart"),
              dropdownMenuItem(AlignmentDirectional.topCenter, "TopCenter"),
              dropdownMenuItem(AlignmentDirectional.topEnd, "TopEnd"),
              dropdownMenuItem(AlignmentDirectional.center, "Center"),
              dropdownMenuItem(AlignmentDirectional.centerEnd, "CenterEnd"),
              dropdownMenuItem(AlignmentDirectional.centerStart, "CenterStart"),
              dropdownMenuItem(
                  AlignmentDirectional.bottomCenter, "BottomCenter"),
              dropdownMenuItem(AlignmentDirectional.bottomEnd, "BottomEnd"),
              dropdownMenuItem(AlignmentDirectional.bottomStart, "BottomStart"),
            ],
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': AlignmentDirectional.topStart,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": false,
            "name": "Alignment",
            "fromVar": false,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': 'clas',
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Button") {
    return Node(
        size: Size(200, 400),
        x: pos.dx,
        y: pos.dy,
        type: "Button",
        id: Uuid().v1(),
        title: "Button",
        inputs: [
          {
            "HaveMax": false,
            "name": "backgroundColor",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': Color.fromARGB(255, 255, 255, 255),
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "fromVar": false,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "foregroundColor",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': Color.fromARGB(255, 255, 255, 255),
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "fromVar": false,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "shadowColor",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': Color.fromARGB(255, 91, 91, 91),
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "fromVar": false,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "elevation",
            "max": false,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'value': 2,
            "isConected": false,
            "haveTextFiled": true,
            "fromVar": false,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            "fromVar": false,
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Child",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': <Node>[],
            "fromVar": false,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "OnClick",
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "GestureDetector") {
    return Node(
        size: Size(200, 280),
        x: pos.dx,
        y: pos.dy,
        type: "GestureDetector",
        id: Uuid().v1(),
        title: "GestureDetector",
        inputs: [
          {
            "HaveMax": false,
            "name": "Child",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            "canSetFromNode": true,
            "fromVar": false,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': <Node>[],
            "fromVar": false,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "onTap",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': <Node>[],
            "fromVar": false,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "onDoubleTap",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': <Node>[],
            "fromVar": false,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "onLongPress",
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Subtract") {
    return Node(
        size: Size(200, 220),
        x: pos.dx,
        y: pos.dy,
        type: "Math",
        id: Uuid().v1(),
        title: "Subtract",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            "fromVar": false,
            'value': 0,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Num1",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            "fromVar": false,
            'value': 0,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Num2",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            "fromVar": false,
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Set Var Name",
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Function",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Dividing") {
    return Node(
        size: Size(200, 220),
        x: pos.dx,
        y: pos.dy,
        type: "Math",
        id: Uuid().v1(),
        title: "Dividing",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            "fromVar": false,
            'value': 0,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Num1",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            "fromVar": false,
            'value': 0,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Num2",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            "fromVar": false,
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Set Var Name",
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Function",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Multiply") {
    return Node(
        size: Size(200, 220),
        x: pos.dx,
        y: pos.dy,
        type: "Math",
        id: Uuid().v1(),
        title: "Multiply",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            "fromVar": false,
            'value': 0,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Num1",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            "fromVar": false,
            'value': 0,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Num2",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            "fromVar": false,
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Set Var Name",
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Function",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Add") {
    return Node(
        size: Size(200, 220),
        x: pos.dx,
        y: pos.dy,
        type: "Math",
        id: Uuid().v1(),
        title: "Add",
        inputs: [
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            "fromVar": false,
            'value': 0,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Num1",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            "fromVar": false,
            'value': 0,
            "isConected": false,
            "haveTextFiled": true,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Num2",
            'FromId': null,
          },
          {
            "HaveMax": false,
            "varId": null,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            "fromVar": false,
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            "name": "Set Var Name",
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Function",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Run") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        type: "Run",
        id: Uuid().v1(),
        title: "Run",
        inputs: [
          {
            "name": "Class",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Class',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            'targetId': null,
            'targetNode': null,
            "canSetFromNode": true,
            'FromId': null,
          },
        ],
        outputs: []);
  } else if (name == "Text") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        size: Size(200, 270),
        type: "Text",
        id: Uuid().v1(),
        title: "Text",
        inputs: [
          {
            "HaveMax": false,
            "name": "Text",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Any',
            "fromVar": false,
            'value': "Text",
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "Color",
            "fromVar": false,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            'value': Color.fromARGB(255, 9, 124, 255),
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "HaveMax": false,
            "name": "Font size",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            "fromVar": false,
            'value': 20,
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "haveDropDown": true,
            "DropDownList": <SmartDropdownMenuItem<dynamic>>[
              dropdownMenuItem(FontWeight.normal, "Normal"),
              dropdownMenuItem(FontWeight.bold, "Bold"),
              dropdownMenuItem(FontWeight.w100, "w100"),
              dropdownMenuItem(FontWeight.w200, "w200"),
              dropdownMenuItem(FontWeight.w300, "w300"),
              dropdownMenuItem(FontWeight.w400, "w400"),
              dropdownMenuItem(FontWeight.w500, "w500"),
              dropdownMenuItem(FontWeight.w600, "w600"),
              dropdownMenuItem(FontWeight.w700, "w700"),
              dropdownMenuItem(FontWeight.w800, "w800"),
              dropdownMenuItem(FontWeight.w900, "w900"),
            ],
            "HaveMax": false,
            "name": "FontWeight",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': "FontWeight",
            "fromVar": false,
            'value': FontWeight.normal,
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": false,
            "varId": null,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Widget",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Widget',
            'value': "Text",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Print") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        size: Size(200, 100),
        type: "Print",
        id: Uuid().v1(),
        title: "Print",
        inputs: [
          {
            "HaveMax": false,
            "name": "Print",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'String',
            "fromVar": false,
            'value': "Hello World!",
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
        ],
        outputs: [
          {
            'targetId': null,
            "name": "Function",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ]);
  } else if (name == "Num") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        isItVar: true,
        type: "var",
        id: Uuid().v1(),
        title: "Num",
        varName: "myVar",
        classId: classId,
        outputs: [
          {
            "HaveMax": false,
            "name": "Num",
            'id': Uuid().v1(),
            'targetId': null,
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Num',
            'targetsId': <String>[],
            'targetNodesId': <Node>[],
            "varId": varid,
            'value': 0,
            'targetNode': null,
            'targetInputInedx': null,
            "haveTextFiled": false,
          },
          {
            "name": "Var",
            'id': Uuid().v1(),
            'targetId': null,
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            'targetsId': <String>[],
            'targetNodesId': <Node>[],
            "varId": varid,
            'value': 0,
            'targetNode': null,
            'targetInputInedx': null,
            "haveTextFiled": false,
          },
        ],
        inputs: []);
  } else if (name == "IconData") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        isItVar: true,
        type: "var",
        id: Uuid().v1(),
        title: "IconData",
        varName: "myVar",
        classId: classId,
        outputs: [
          {
            "HaveMax": false,
            "name": "IconData",
            'id': Uuid().v1(),
            'targetId': null,
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'IconData',
            'targetsId': <String>[],
            'targetNodesId': <Node>[],
            "varId": varid,
            'value': Icons.access_alarm_sharp,
            'targetNode': null,
            'targetInputInedx': null,
            "haveTextFiled": false,
          },
          {
            "name": "Var",
            'id': Uuid().v1(),
            'targetId': null,
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            'targetsId': <String>[],
            'targetNodesId': <Node>[],
            "varId": varid,
            'value': 0,
            'targetNode': null,
            'targetInputInedx': null,
            "haveTextFiled": false,
          },
        ],
        inputs: []);
  } else if (name == "color") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        isItVar: true,
        type: "var",
        id: Uuid().v1(),
        title: "Color",
        varName: "myVar",
        outputs: [
          {
            "name": "Color",
            'id': Uuid().v1(),
            'targetId': null,
            'targetsId': <String>[],
            'targetNodesId': <Node>[],
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Color',
            "varId": varid,
            'value': Color.fromARGB(255, 9, 124, 255),
            'targetNode': null,
            'targetInputInedx': null,
            "haveTextFiled": false,
          },
          {
            "name": "Var",
            'id': Uuid().v1(),
            'targetId': null,
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            'targetsId': <String>[],
            'targetNodesId': <Node>[],
            "varId": varid,
            'value': 0,
            'targetNode': null,
            'targetInputInedx': null,
            "haveTextFiled": false,
          },
        ],
        inputs: []);
  } else if (name == "SetVar") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        isItVar: false,
        size: Size(200, 160),
        type: "SetVar",
        id: Uuid().v1(),
        title: "SetVar",
        outputs: [
          {
            'targetId': null,
            "name": "Function",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ],
        inputs: [
          {
            "name": "Var",
            "fromVar": false,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "name": "New Value",
            "fromVar": false,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': "null",
            'value': null,
            "isConected": false,
            "haveTextFiled": true,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
        ]);
  } else if (name == "If") {
    return Node(
        x: pos.dx,
        y: pos.dy,
        isItVar: false,
        size: Size(200, 275),
        type: "If",
        id: Uuid().v1(),
        title: "If",
        outputs: [
          {
            'targetId': null,
            "name": "Function",
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': "clas",
            'targetNode': null,
            'targetInputInedx': null,
          },
        ],
        inputs: [
          {
            "name": "State One",
            "fromVar": false,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "showOnTitle": true,
            'show': false,
            "name": "State",
            "fromVar": false,
            "haveDropDown": true,
            "DropDownList": <SmartDropdownMenuItem<dynamic>>[
              dropdownMenuItem("==", "=="),
              dropdownMenuItem(">", ">"),
              dropdownMenuItem("<", "<"),
              dropdownMenuItem("!=", "!="),
              dropdownMenuItem(">=", ">="),
              dropdownMenuItem("<=", "<="),
            ],
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            "canSetFromNode": false,
            "varId": null,
            'FromId': null,
          },
          {
            "name": "State Two",
            "fromVar": false,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            'value': null,
            "isConected": false,
            "haveTextFiled": false,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "name": "if True do",
            "fromVar": false,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': <Node>[],
            "isConected": false,
            "haveTextFiled": false,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
          {
            "name": "if False do",
            "fromVar": false,
            'id': Uuid().v1(),
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Function',
            'value': <Node>[],
            "isConected": false,
            "haveTextFiled": false,
            "canSetFromNode": true,
            "varId": null,
            'FromId': null,
          },
        ]);
  } else {
    return Node(
        x: pos.dx,
        y: pos.dy,
        isItVar: true,
        type: "var",
        id: Uuid().v1(),
        title: "String",
        varName: "myVar",
        outputs: [
          {
            "name": "String",
            'id': Uuid().v1(),
            'targetId': null,
            'targetsId': <String>[],
            'targetNodesId': <Node>[],
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'String',
            "varId": varid,
            'value': "String",
            'targetNode': null,
            'targetInputInedx': null,
            "haveTextFiled": false,
          },
          {
            "name": "Var",
            'id': Uuid().v1(),
            'targetId': null,
            'LineDx': 0,
            'LineDy': 0,
            'valueType': 'Var',
            'targetsId': <String>[],
            'targetNodesId': <Node>[],
            "varId": varid,
            'value': 0,
            'targetNode': null,
            'targetInputInedx': null,
            "haveTextFiled": false,
          },
        ],
        inputs: []);
  }
}

SmartDropdownMenuItem dropdownMenuItem(dynamic value, String text) {
  return SmartDropdownMenuItem(value: value, child: Text(text));
}
