createDomainEntity method
void
createDomainEntity(
- String pathPage,
- String pageName,
- String apiName,
- 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);
join(path, '${apiName.snakeCase}_entity.dart').write(classResponse);
StatusHelper.generated(join(path, '${apiName.snakeCase}_entity.dart'));
}