Search code examples
androidfluttergoogle-playandroid-assets

Using Sub-Directory within install-time asset delivery in Flutter


I am trying to implement Play Asset Delivery for my Flutter app using package named FlutterPlayAssetDelivery. The basic implementation (of install-time delivery) is done. My folder structure looks something like this: assets:

  1. reset.png
  2. fu(folder)

Now there is a file under folder 'fu' stated as: fu\logo.png now when i try to access assets inside 'fu' folder inside, it fails to access the assets at path: fu/logo.png

P.S I am using the bundletool to test asset delivery.


Solution

  • For now, the play asset delivery doesn't support any directory based organization. Thus, in order to access your files correctly, you must implement a different logic to organize the files inside the assetpack.

    For instance, Suppose the avatar image files organization logic is:

    Avatar/image1.jpg
    

    in order to store a group of avatar images inside asset-packs, you can organize the file by renaming it as:

    Avatar-image1.jpg