JsonModel.fromMap constructor

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

Implementation

factory JsonModel.fromMap(
  String fileName,
  Map<String, dynamic> jsonMap, {
  String? packageName,
  String? indexPath,
  String? relativePath,
}) {
  final dartDeclarations = <DartDeclaration>[];
  jsonMap.forEach((key, value) {
    return dartDeclarations.add(DartDeclaration.fromKeyValue(key, value));
  });
  // add key to templatestring
  // add valuetype to templatestring
  return JsonModel(
    fileName,
    dartDeclarations,
    relativePath: relativePath,
    packageName: packageName,
    indexPath: indexPath,
  );
}