fromKeyValue static method

DartDeclaration fromKeyValue(
  1. dynamic key,
  2. dynamic val
)

Implementation

static DartDeclaration fromKeyValue(key, val) {
  var dartDeclaration = DartDeclaration(jsonKey: JsonKeyMutate());
  dartDeclaration = fromCommand(
    Commands.valueCommands,
    dartDeclaration,
    testSubject: val,
    key: key,
    value: val,
  );

  dartDeclaration = fromCommand(Commands.keyComands, dartDeclaration,
      testSubject: key, key: key, value: val);
  if (dartDeclaration.type == null || dartDeclaration.name == null) {
    exit(0);
  }
  return dartDeclaration;
}