createView function

Future<void> createView(
  1. String name, {
  2. String withArgument = '',
  3. String onCommand = '',
})

Implementation

Future<void> createView(
  String name, {
  String withArgument = '',
  String onCommand = '',
}) async {
  var sample = GetViewSample(
    '',
    '${name.pascalCase}View',
    '',
    '',
    PubspecUtils.isServerProject,
  );
  if (withArgument.isNotEmpty) {
    sample.customContent = await loadContent(withArgument, name);
  }

  final extraFolder = PubspecUtils.extraFolder ?? true;
  handleFileCreate(
    name,
    'view',
    onCommand,
    onCommand.isNotEmpty ? extraFolder : true,
    sample,
    'views',
  );
}