Package constructor

const Package({
  1. required String name,
  2. required String version,
  3. String? languageVersion,
  4. required bool isRootPackage,
  5. String? filePath,
  6. String? rootUri,
})

🍃 JetLeaf Framework - Represents a Dart package within the runtime context.

This metadata is usually generated at compile time (JIT or AOT) to describe:

  • The root application package
  • Any dependent packages (e.g., args, collection)

This class allows tools, scanners, and the reflection system to access package-specific information like name, version, and file location.

Example:

Package pkg = ...;
print(pkg.getName()); // => "jetleaf"
print(pkg.getIsRootPackage()); // => true

Implementation

const Package({
  required String name,
  required String version,
  String? languageVersion,
  required bool isRootPackage,
  String? filePath,
  String? rootUri,
}) : _filePath = filePath, _languageVersion = languageVersion, _version = version, _name = name, _isRootPackage = isRootPackage, _rootUri = rootUri;