toRawData function

RawData toRawData(
  1. SrcData srcData,
  2. CometYaml cometYaml
)

Src --> Raw

Implementation

RawData toRawData(SrcData srcData, CometYaml cometYaml) {
  final folderPath =
      '${cometYaml.flutterProject.root}/$genRoot/$genDataFolderName';
  final filePath = '$folderPath$dartExt';

  final List<RawShelf> rawShelves = [];
  for (final srcShelf in srcData.shelves) {
    final rawShelf = toRawShelf(
      srcShelf,
      folderPath,
      cometYaml,
    );
    rawShelves.add(rawShelf);
  }

  final dart = toDartData(srcData, cometYaml);
  return RawData(
    shelves: rawShelves,
    fileContent: dart,
    folderPath: folderPath,
    filePath: filePath,
  );
}