createMapper method

void createMapper(
  1. String pathPage,
  2. Map map
)

Implementation

void createMapper(String pathPage, Map map) {
  final variable = map.keys;
  DirectoryHelper.createDir(pathPage);
  join(pathPage, 'mapper.dart').write(
      '${variable.map((e) => """import 'data/models/response/${e.toString().snakeCase}_response.dart' as ${e.toString().snakeCase}_response;
import 'domain/entities/${e.toString().snakeCase}_entity.dart' as ${e.toString().snakeCase}_entity""").join(';\n')};');

  StatusHelper.generated(join(pathPage, 'mapper.dart'));
}