You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The native assets feature is intended to build and bundle native libraries with a Dart application and abstract away the resolution and loading of these libraries.
This idea can be extended to any resource that one would want to bundle with an application. These resources can be text files, images, binary data, etc. Similar to native libraries, these can be bundled as files next to the applications executable, or they can be bundled directly into the executable.
These resources could be registered in build.dart, just like native libraries. This also allows to generate resources at compile time.
Native assets are identified using library uris, like package:a/a.dart (assed id). This is implemented with @Native() external functions, where you can specify the asset id of the asset, in which the function can be found (#49803). To be able to load other asset types, there need to be different APIs that can load assets using asset ids.
One solution is to add a new Asset class (or Resource) that accepts an asset id and can load the asset similar to a File.
That is indeed WIP, see https://dart-review.googlesource.com/c/sdk/+/351140. Basically, we need to provide an Asset interface similar to the one in Flutter, and implement where the assets would be stored when running commands such as dart build.
lrhn
added
the
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
label
Mar 14, 2024
The native assets feature is intended to build and bundle native libraries with a Dart application and abstract away the resolution and loading of these libraries.
This idea can be extended to any resource that one would want to bundle with an application. These resources can be text files, images, binary data, etc. Similar to native libraries, these can be bundled as files next to the applications executable, or they can be bundled directly into the executable.
These resources could be registered in
build.dart
, just like native libraries. This also allows to generate resources at compile time.Native assets are identified using library uris, like
package:a/a.dart
(assed id). This is implemented with@Native() external
functions, where you can specify the asset id of the asset, in which the function can be found (#49803). To be able to load other asset types, there need to be different APIs that can load assets using asset ids.One solution is to add a new
Asset
class (orResource
) that accepts an asset id and can load the asset similar to aFile
.@dcharkes
The text was updated successfully, but these errors were encountered: