createDomainEntity method

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

Implementation

void createDomainEntity(
  String pathPage,
  String pageName,
  String apiName,
) {
  final apiClassName = apiName.pascalCase;

  final path = join(pathPage, 'domain', 'entities');
  DirectoryHelper.createDir(path);
  join(path, '${apiName}_entity.dart')
      .write('''import 'package:core/core.dart';

class ${apiClassName}Entity extends Equatable {
const ${apiClassName}Entity({
  required this.token,
});
final String token;

@override
List<Object?> get props => [token];
}''');

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