registerLiveCommand function

Future<LiveRegistration> registerLiveCommand({
  1. required String fullName,
  2. required String className,
  3. required String importPath,
})

Registers the command class className (from importPath, relative to lib/) under fullName in lib/bootstrap/live_commands.dart, creating the file when it doesn't exist.

Implementation

Future<LiveRegistration> registerLiveCommand({
  required String fullName,
  required String className,
  required String importPath,
}) => _register(
  path: liveCommandsRegistryPath,
  template: liveCommandsRegistryTemplate,
  configName: 'live_commands',
  label: 'Live Command',
  importPath: importPath,
  insert: (String file) => insertLiveCommandRegistration(
    file,
    fullName: fullName,
    className: className,
  ),
  hasMap: (String file) => hasRegistryMap(
    file,
    variable: 'liveCommands',
    type: 'LiveCommand Function()',
  ),
);