DataAsset class final

Data bundled with a Dart or Flutter application.

A data asset is accessible in a Dart or Flutter application. To retrieve an asset at runtime, the id is used. This enables access to the asset irrespective of how and where the application is run.

An data asset must provide a DataAsset.file. The Dart and Flutter SDK will bundle this code in the final application.

Constructors

DataAsset({required Uri file, required String name, required String package})
DataAsset.fromEncoded(EncodedAsset asset)
Constructs a DataAsset from an EncodedAsset.
factory

Properties

file Uri
The file to be bundled with the Dart or Flutter application.
final
hashCode int
The hash code for this object.
no setteroverride
id String
The identifier for this data asset.
no setter
name String
The name of this asset, which must be unique for the package.
final
package String
The package which contains this asset.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

encode() EncodedAsset
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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

Constants

type → const String