PackageMetadata class
All metadata pub_doctor needs to evaluate a single package dependency.
Populated by PubApiClient (pub.dev data) and enriched by GitHubClient (repository health). Immutable after construction.
Constructors
-
PackageMetadata({required String name, required Version currentVersion, Version? latestVersion, Version? latestStableVersion, Uri? repositoryUrl, Uri? issueTrackerUrl, String? publisherDomain, double? pubScore, double? pubPopularity, int? pubLikes, VersionConstraint? sdkConstraint, VersionConstraint? flutterConstraint, bool? isNullSafe, bool? isDiscontinued, bool? isUnlisted, List<
Release> releases = const [], PackageVerification verification = PackageVerification.none, RepoHealth? repoHealth, DateTime? fetchedAt, bool isFromCache = false}) -
Creates a PackageMetadata.
const
Properties
- currentVersion → Version
-
The version currently declared in the project's
pubspec.lock.final - fetchedAt → DateTime?
-
When this metadata was last fetched from the network.
final
- flutterConstraint → VersionConstraint?
-
Flutter SDK constraint declared in the package's pubspec.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasVerifiedPublisher → bool
-
truewhen the package belongs to a verified publisher.no setter - isDiscontinued → bool?
-
Whether the publisher has officially marked this package discontinued.
final
- isFlutterFavourite → bool
-
truewhen the package has Flutter Favourite status.no setter - isFromCache → bool
-
truewhen this metadata was served from the local disk cache.final - isNullSafe → bool?
-
Whether the package opts in to Dart null safety.
final
- issueTrackerUrl → Uri?
-
Issue tracker URL taken from the package's pubspec.
final
- isUnlisted → bool?
-
Whether the package is hidden from pub.dev search results.
final
- latestStableVersion → Version?
-
The most recent stable (non-pre-release) version.
final
- latestVersion → Version?
-
The most recent version of any stability level (including pre-releases).
final
- name → String
-
The package name as it appears on pub.dev.
final
- pubLikes → int?
-
Total number of pub.dev likes.
final
- publisherDomain → String?
-
Publisher domain, e.g.
dart.devorflutter.dev.final - pubPopularity → double?
-
pub.dev popularity score, normalised to the range
0, 100.final - pubScore → double?
-
pub.dev quality score, normalised to the range
0, 100.final -
releases
→ List<
Release> -
Full release history, sorted newest-first.
final
- repoHealth → RepoHealth?
-
GitHub repository health metrics, if available.
final
- repositoryUrl → Uri?
-
Repository URL taken from the package's pubspec.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sdkConstraint → VersionConstraint?
-
Dart SDK constraint declared in the package's pubspec.
final
- verification → PackageVerification
-
pub.dev publisher verification and Flutter Favourite status.
final
Methods
-
copyWith(
{RepoHealth? repoHealth}) → PackageMetadata -
Returns a copy of this metadata with
repoHealthreplaced. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited