MockLibraryGeneratorParams constructor

MockLibraryGeneratorParams({
  1. required MirrorSystem mirrorSystem,
  2. required List<LibraryMirror> forceLoadedMirrors,
  3. required void onInfo(
    1. String
    ),
  4. required void onWarning(
    1. String
    ),
  5. required void onError(
    1. String
    ),
  6. required RuntimeScannerConfiguration configuration,
  7. required List<Package> packages,
})

Configuration parameters for creating a MockLibraryGenerator.

This bundles all required dependencies and configuration needed to instantiate a mock library generator.

{@template params_example} Example:

final params = MockLibraryGeneratorParams(
  mirrorSystem: currentMirrorSystem(),
  forceLoadedMirrors: myLibraries,
  onInfo: print,
  onError: print,
  configuration: config,
  packages: [Package(name: 'test', version: '1.0.0')],
);

Creates parameter bundle for mock library generator construction.

All parameters are required and used to initialize the generator:

  • mirrorSystem: Typically currentMirrorSystem()
  • forceLoadedMirrors: Can be empty for basic cases
  • onInfo/onError: Should handle logging appropriately
  • configuration: Controls what gets scanned
  • packages: Should include at least the current package

Implementation

MockLibraryGeneratorParams({
  required this.mirrorSystem,
  required this.forceLoadedMirrors,
  required this.onInfo,
  required this.onWarning,
  required this.onError,
  required this.configuration,
  required this.packages,
});