SentryAssetBundle class

An AssetBundle which creates automatic performance traces for loading assets.

You can wrap other AssetBundles in it:

SentryAssetBundle(bundle: someOtherAssetBundle)

If you're not providing any AssetBundle, it falls back to the rootBundle.

If you want to use the SentryAssetBundle by default you can achieve this with the following code:

DefaultAssetBundle(
  bundle: SentryAssetBundle(),
  child: MaterialApp(
    home: MyScaffold(),
  ),
);

Image.asset, for example, will then use SentryAssetBundle.

Implemented types

Constructors

SentryAssetBundle({Hub? hub, AssetBundle? bundle, bool enableStructuredDataTracing = true})

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

clear() → void
If this is a caching asset bundle, clear all cached data.
override
evict(String key) → void
If this is a caching asset bundle, and the given key describes a cached asset, then evict the asset from the cache so that the next time it is loaded, the cache will be reread from the asset bundle.
override
load(String key) Future<ByteData>
Retrieve a binary resource from the asset bundle as a data stream.
override
loadBuffer(String key) Future<ImmutableBuffer>
Retrieve a binary resource from the asset bundle as an immutable buffer.
override
loadString(String key, {bool cache = true}) Future<String>
Retrieve a string from the asset bundle.
override
loadStructuredBinaryData<T>(String key, FutureOr<T> parser(ByteData data)) Future<T>
Retrieve ByteData from the asset bundle, parse it with the given function, and return that function's result.
override
loadStructuredData<T>(String key, _StringParser<T> parser) Future<T>
Retrieve a string from the asset bundle, parse it with the given function, and return that function's result.
override
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