LightningRunner constructor

LightningRunner({
  1. bool watchDependencies = true,
  2. Duration debounceInterval = const Duration(seconds: 1),
  3. bool onBeforeReload(
    1. BeforeReloadContext ctx
    )?,
  4. void onAfterReload(
    1. AfterReloadContext ctx
    )?,
  5. void onDirectoryWatching(
    1. Directory directory
    )?,
  6. void onFileChange(
    1. File file
    )?,
  7. void onFileCreate(
    1. File file
    )?,
  8. void onFileDelete(
    1. File file
    )?,
})

Implementation

LightningRunner({
  this.watchDependencies = true,
  this.debounceInterval = const Duration(seconds: 1),
  this.onBeforeReload,
  this.onAfterReload,
  this.onDirectoryWatching,
  this.onFileChange,
  this.onFileCreate,
  this.onFileDelete,
}) {
  if (!File('pubspec.yaml').existsSync()) {
    throw StateError('''
      Error: [pubspec.yaml] file not found in current directory.
      For hot code reloading to function properly, Dart needs to be run from the root of your project.''');
  }
}