createRepoImpl function
void
createRepoImpl(
- String title,
- 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);
}