-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include package in AssetGenImage path property #248
Comments
Can you tell me your use case here?
What's the benefit of this? |
The reason is to encapsulate the package name so we can use the AssetGenImage without parameter, e.g. In other cases there is no final imageData = await rootBundle.load(res.Assets.images.flutter3.path);
final uiImage = await decodeImageFromList(Uint8List.view(imageData.buffer)); |
On the Flame engine we don't use widgets. Having a generated path with the package name would be helpful. It was possible to get that before #229 (via |
When String get path => _assetName;
// THIS
String get keyName => 'packages/$packageName/\$_assetName'; // 'packages/example_resources/assets/images/flutter3.jpg' or do you need always it? when |
If you would like to keep the I would still prefer a property where I do not need to now the value of So I think of something like String get keyName => _package == null ? _assetName : 'packages/$packageName/$_assetName'; or // when package_parameter_enabled is false
String get keyName => _assetName;
// when package_parameter_enabled is true:
String get keyName => 'packages/$packageName/$_assetName'; |
@kolotum When package_parameter_enabled = String get path => _assetName;
String get keyName => 'packages/$packageName/\$_assetName'; When package_parameter_enabled = String get path => _assetName;
String get keyName => _assetName; |
@kolotum @renancaraujo |
Similiar to AssetImage's keyName property it would be helpful to change AssetGenImage's
path
property to include package so we can hide the package name inside of AssetGenImage:_package could be generated, e.g.
final String? _package = 'example_resources';
without
package_parameter_enabled: true
:final String? _package;
SvgGenImage could be changed accordingly.
The text was updated successfully, but these errors were encountered: