generate function

Future<void> generate (
  1. {ArgResults results,
  2. Generator generator}
)

This function takes the results from the ArgParser and act as expected.

Implementation

Future<void> generate({
  ArgResults results,
  Generator generator,
}) async {
  switch (results.command.name) {
    case "page":
      await generator.handleFileCreate(results);
      break;
    case "widget":
      await generator.handleFileCreate(results);
      break;
    case "repository":
      await generator.handleFileCreate(results, isOnlyClass: true);
      break;
    case "model":
      await generator.handleFileCreate(results, isOnlyClass: true);
      break;
    case "bloc":
      await generator.createBloc(results);
      break;
  }
}