Assets class
This class provides access to 'assets' packaged in your application.
TO A POINT!
Applications deployed using dart pub global activate
or if you are just
running from a local source directory then your app will have
access to their
assets.
If you have AOT compiled your application (e.g. dart compile or dcli compile) then you will NOT have access to the assets as they are not deployed.
To create an asset place it under:
lib/src/assets
Unlike flutter you don't need to create any entries in your pubspec.yaml.
Constructors
- Assets()
-
factory
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
-
list(
String pattern, {required String root, bool recursive = false}) → List< String?> -
returns a list of assets located under the given
root
directory. Theroot
directory must be relative to the parent of the 'asset' directory. -
loadBytes(
String path) → Uint8List - loads an asset as a byte buffer.
-
loadString(
String path) → String - Loads an asset as a string.
-
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