generateState static method

Future<void> generateState(
  1. String name, {
  2. bool force = false,
  3. String type = 'bloc',
  4. bool onlyState = false,
})

Implementation

static Future<void> generateState(
  String name, {
  bool force = false,
  String type = 'bloc',
  bool onlyState = false,
}) async {
  await generateCode(
    name,
    stub: type == 'bloc'
        ? 'bloc_state${onlyState ? '_only' : ''}.stub'
        : 'cubit_state${onlyState ? '_only' : ''}.stub',
    path: AppEnum.blocsDir,
    suffix: 'state',
    force: force,
  );
}