Package class abstract

Represents a Dart package within the JetLeaf reflection and code generation system.

A Package is a pure metadata model describing a Dart package and its relationship to the JetLeaf ecosystem. It is used by the runtime provider, class loader, and code generator to understand where types originate and how they should be resolved.

A Package encapsulates:

  • Package name and semantic version
  • Dart language version constraints
  • Package root location (file system path or URI)
  • Dependency metadata (runtime, dev, and JetLeaf-specific)
  • Whether the package is the root application package

Design Notes

  • This class performs no I/O or resolution
  • All instances are immutable
  • It acts as a declarative description only
  • Package resolution and graph construction occur elsewhere

Usage

Package instances are typically constructed from:

  • package_graph.json
  • pubspec.yaml
  • Runtime package discovery

and then consumed by:

  • Class loaders
  • Reflection utilities
  • Code generators
Inheritance
Mixed-in types

Constructors

Package({required String name, required String version, String? languageVersion, required bool isRootPackage, String? filePath, String? rootUri, Iterable<String> jetleafDependencies = const [], Iterable<String> dependencies = const [], Iterable<String> devDependencies = const []})
Represents a Dart package within the JetLeaf reflection and code generation system.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
override
getDependencies() Iterable<String>
Returns all dependencies of this package (including jetleaf dependencies too - if any).
getDevDependencies() Iterable<String>
Returns all dev dependencies of this package (including jetleaf dependencies too - if any).
getFilePath() String?
Returns the absolute file system path to the package root, or null if unavailable.
getIsRootPackage() bool
Returns true if this package is the root application package.
getJetleafDependencies() Iterable<String>
Returns the JetLeaf-specific dependencies of this package.
getLanguageVersion() String?
Returns the Dart language version constraint of the package, or null if it was not specified.
getName() String
Returns the name of the package.
getRootUri() String?
Returns the root URI of the package, or null if unavailable.
getVersion() String
Returns the version of the package.
isJetleafPackaged() bool
Returns true if this package is JetLeaf-enabled.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object>
Serializes this declaration into a JSON-compatible map.
override
toString() String
A string representation of this object.
inherited
toStringOptions() ToStringOptions
override

Operators

operator ==(Object other) bool
The equality operator.
inherited