fromMap static method

JsonModel fromMap(
  1. String fileName,
  2. Map<String, dynamic> jsonMap, {
  3. String? relativePath,
})

Implementation

static JsonModel fromMap(String fileName, Map<String, dynamic> jsonMap, {String? relativePath}) {
  var dartDeclarations = <DartDeclaration>[];
  jsonMap.forEach((key, value) {
    var declaration = DartDeclaration.fromKeyValue(key, value);

    return dartDeclarations.add(declaration);
  });
  // add key to templatestring
  // add valuetype to templatestring
  return JsonModel(fileName, dartDeclarations, relativePath);
}