createRepoImpl function

void createRepoImpl(
  1. String title,
  2. dynamic dir
)

Implementation

void createRepoImpl(String title, dir) {
  String newTitle = capitalize(title);
  print("--Writing $newTitle repository implement......");
  String repoImplTemplate = '''
  import '${title.toLowerCase()}_repository.dart';
  import '../service/${title.toLowerCase()}_service.dart';

  class ${newTitle}RepositoryImpl implements ${newTitle}Repository {

    final ${newTitle}Service _service;

    ${newTitle}RepositoryImpl({${newTitle}Service? service}) : _service = service ?? ${newTitle}Service();
  }
  ''';

  File("${dir.path}/${title.toLowerCase()}_repository_impl.dart")
      .writeAsStringSync(repoImplTemplate);
}