AnalysisResult class

Contains the results of an asset analysis operation.

Provides access to all analyzed assets, detected issues, unused assets, and aggregate statistics like total size and size by type.

Constructors

AnalysisResult({required List<AssetDetail> assets, required Map<String, String> scanErrors, required DateTime analyzedAt, required String projectRoot, List<AssetDetail>? unusedAssets})
Creates an analysis result.

Properties

analyzedAt DateTime
When the analysis was performed.
final
assets List<AssetDetail>
All assets found and analyzed in the project.
final
hashCode int
The hash code for this object.
no setterinherited
projectRoot String
Root path of the analyzed project.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scanErrors Map<String, String>
Errors encountered during scanning (path -> error message).
final
unusedAssets List<AssetDetail>
Assets detected as potentially unused (not referenced in Dart code).
final

Methods

getCountByType() Map<String, int>
Returns a map of asset type to file count.
getIssuesByType() Map<IssueType, List<AssetDetail>>
Groups assets by their issue types.
getLargestAssets(int limit) List<AssetDetail>
Returns the largest assets, sorted by size descending.
getSizeByType() Map<String, int>
Returns a map of asset type to total size in bytes.
getTotalIssues() int
Returns the total count of all issues across all assets.
getTotalSize() int
Returns the total size of all assets in bytes.
getUnusedTotalBytes() int
Returns total bytes of unused assets.
hasIssues() bool
Returns true if any assets have optimization issues.
hasUnusedAssets() bool
Returns true if any unused assets were detected.
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