createDomainEntity method

void createDomainEntity(
  1. String pathPage,
  2. String pageName,
  3. String apiName,
  4. dynamic response,
)

Implementation

void createDomainEntity(
  String pathPage,
  String pageName,
  String apiName,
  dynamic response,
) {
  final apiClassName = apiName.pascalCase;
  String classResponse = '''import 'package:core/core.dart';

''';
  classResponse += getEntityClass(apiClassName, 'Entity', '', response, true);

  final path = join(pathPage, 'domain', 'entities');
  DirectoryHelper.createDir(path, recursive: true);
  join(path, '${apiName.snakeCase}_entity.dart').write(classResponse);

  StatusHelper.generated(join(path, '${apiName.snakeCase}_entity.dart'));
}