crateBlocFolder function
Implementation
Future<void> crateBlocFolder(String arg) async {
Map<String, String> path = {
"lib/screens/$arg/${arg}_view.dart": BlocData.generateViewFile(
toPascalCase(arg),
"${arg}_bloc.dart",
),
"lib/screens/$arg/${arg}_bloc.dart": BlocData.generateBlocFile(
toPascalCase(arg),
"${arg}_state.dart",
"${arg}_event.dart",
"${arg}_bloc.freezed.dart",
),
"lib/screens/$arg/${arg}_state.dart": BlocData.generateStateFile(
toPascalCase(arg),
"${arg}_bloc.dart",
),
"lib/screens/$arg/${arg}_event.dart": BlocData.generateEventFile(
toPascalCase(arg),
"${arg}_bloc.dart",
),
};
for (var p in path.keys) {
await _createBlocPath(p, code: path[p]);
}
await callRunner();
}