@@ -53,6 +53,11 @@ import 'syntax.g.dart';
5353/// specified location on the current system into the application bundle.
5454final class CodeAsset {
5555 /// The id of this code asset.
56+ ///
57+ /// The identifier is a uri `package:<package>/<name>` . In build hooks,
58+ /// `<package>` must be the name of the package containing the build hook.
59+ /// Code assets are name-spaced in their own package to avoid naming
60+ /// conflicts.
5661 final String id;
5762
5863 /// The link mode for this native code.
@@ -71,18 +76,23 @@ final class CodeAsset {
7176 ///
7277 /// If the [linkMode] is [LookupInProcess] , or [LookupInExecutable] the file
7378 /// must be omitted in the [BuildOutput] .
79+ ///
80+ /// Code assets with [DynamicLoadingBundled] may not have conflicting file
81+ /// names, the dynamic linker treats them as a single namespace.
7482 final Uri ? file;
7583
7684 /// Constructs a native code asset.
7785 ///
7886 /// The [id] of this asset is a uri `package:<package>/<name>` from [package]
79- /// and [name] .
87+ /// and [name] . In build hooks, [package] must be the name of the package
88+ /// containing the build hook. Code assets are name-spaced in their own
89+ /// package to avoid naming conflicts.
8090 CodeAsset ({
8191 required String package,
8292 required String name,
83- required LinkMode linkMode,
84- Uri ? file,
85- }) : this ._(id : 'package:$package /$name ' , linkMode : linkMode, file : file) ;
93+ required this . linkMode,
94+ this . file,
95+ }) : id = 'package:$package /$name ' ;
8696
8797 CodeAsset ._({required this .id, required this .linkMode, required this .file});
8898
0 commit comments