Skip to content
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

[FEATURE REQUEST] Documentation for bundling Flutter assets #291

Open
Levi-Lesches opened this issue Dec 31, 2024 · 1 comment · May be fixed by #293
Open

[FEATURE REQUEST] Documentation for bundling Flutter assets #291

Levi-Lesches opened this issue Dec 31, 2024 · 1 comment · May be fixed by #293

Comments

@Levi-Lesches
Copy link

Levi-Lesches commented Dec 31, 2024

💬 Description

Some use cases require referencing files by ms-appx:/// URIs. By default, this package will bundle Flutter assets the usual way, which results in the following URI:

flutter: 
  assets: 
    - assets/image.jpg
final imageUri = Uri.parse("ms-appx:///data/flutter_assets/assets/image.jpg");

This should probably be documented, as I didn't see it anywhere in the README and had to validate it on my own.

❓ Platform

Windows


It would be nice if we could just refer to them by their filenames, like Image.asset() lets us do:

import "package:msix/msix.dart";

final imageUri = Msix.assetUri("assets/image.jpg");

Where

Uri Msix.assetUri(String path) => Uri.parse("ms-appx:///data/flutter_assets/$path");

That would help keep code cleaner, reduce the chances of typos, and allow this package to be more flexible in the future.

@Levi-Lesches
Copy link
Author

I opened a PR at #293 with the new function and additions to the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant