Skip to content

[FEATURE REQUEST] Documentation for bundling Flutter assets #291

@Levi-Lesches

Description

@Levi-Lesches

💬 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions