MockLibraryGeneratorParams constructor
MockLibraryGeneratorParams({
- required MirrorSystem mirrorSystem,
- required List<
LibraryMirror> forceLoadedMirrors, - required void onInfo(),
- required void onWarning(),
- required void onError(),
- required RuntimeScannerConfiguration configuration,
- 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
: TypicallycurrentMirrorSystem()
forceLoadedMirrors
: Can be empty for basic casesonInfo/onError
: Should handle logging appropriatelyconfiguration
: Controls what gets scannedpackages
: 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,
});