generateBlocFile static method

dynamic generateBlocFile(
  1. String className,
  2. String ePath,
  3. String sPath,
  4. dynamic fPath,
)

Implementation

static generateBlocFile(String className, String ePath, String sPath, fPath) {
  return '''
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:meta/meta.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part '$ePath';
part '$sPath';
part '$fPath';


class ${className}Bloc extends Bloc<${className}Event, ${className}State> {
${className}Bloc() : super(${className}State.initial()) {
  on<${className}Event>((event, emit) {
    // TODO: implement event handler
  });
}
}
  ''';
}