createLocator method

void createLocator(
  1. String pathPage,
  2. String pageName,
  3. String className,
  4. String methodName,
)

Implementation

void createLocator(
  String pathPage,
  String pageName,
  String className,
  String methodName,
) {
  final path = pathPage;
  DirectoryHelper.createDir(path);
  join(path, 'locator.dart').write('''import 'package:core/core.dart';

import 'presentation/cubit/${pageName}_cubit.dart';

void setupLocator$className() {
// *Cubit
locator.registerFactory(() => ${className}Cubit());
}''');

  StatusHelper.generated(join(path, 'locator.dart'));
}