# Asset class abstract

🍃 JetLeaf Framework - Represents a non-Dart static resource (e.g., HTML, CSS, images).

The compiler generates implementations of this class to expose metadata and raw content for embedded or served assets during runtime.

Represents a static asset (e.g., HTML, CSS, JS, images, or any binary file) that is bundled with the project but not written in Dart code.

This is typically used in frameworks like JetLeaf for handling:

- Static web resources (HTML templates, stylesheets)
- Server-rendered views
- Embedded images or configuration files

These assets are typically provided via compiler-generated implementations and may be embedded in memory or referenced via file paths.

### Example

    final asset = MyGeneratedAsset(); // implements Asset
    print(asset.getFilePath()); // "resources/index.html"
    print(utf8.decode(asset.getContentBytes())); // "<html>...</html>"

Inheritance
  - Object
  - ResourceDeclaration
  - Asset
Available extensions
  - AssetExtension

## Constructors

Asset.new({required String filePath, required String fileName, required String packageName, required Uint8List contentBytes})
  🍃 JetLeaf Framework - Represents a non-Dart static resource (e.g., HTML, CSS, images).
  const

## Properties

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

## Methods

getContentAsString() → String

  Available on Asset, provided by the AssetExtension extension

  Extension methods for Asset objects.
getContentBytes() → Uint8List
  Returns the binary content of the asset (same as `_contentBytes`).
getFileName() → String
  Returns the name of the file (same as `_fileName`).
getFilePath() → String
  Returns the full path to the file (same as `_filePath`).
getPackageName() → String?
  Returns the name of the originating package (same as `_packageName`).
getUniqueName() → String
  Returns a unique name for the asset, combining the package name and file name.
noSuchMethod(Invocation invocation) → dynamic
  Invoked when a nonexistent method or property is accessed.
  inherited
toJson() → Map<String, Object>
  Serializes this resource to a JSON-encodable map.
  override
toString() → String
  Standard string representation of this resource.
  inherited

## Operators

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