2

The docs say

During a build, Flutter places assets into a special archive called the asset bundle, which apps can read from at runtime.

If I want to refer to the assets folder in places like webviews, I can't do that since I don't know the path of the asset folder on device.

I tried the file:///android_assets url but that doesn't work.

Specifically, I am looking to get this working.

Dev Aggarwal
  • 7,627
  • 3
  • 38
  • 50
  • https://flutter.io/assets-and-images/ – pskink Jul 11 '18 at 05:42
  • Try This [Link](https://flutter-io-deploy-one.firebaseapp.com/assets-and-images/) – amit Jul 11 '18 at 10:39
  • @pskink I want the path of the assets, so that I can use it outside of the context of flutter. The above links, are literally linked in my question. All flutter gives is an interface to read the file, but doesn't tell me its canonical path on the OS. – Dev Aggarwal Jul 15 '18 at 18:25
  • what do you want to achieve actually? – pskink Jul 15 '18 at 18:36
  • I want to be able to access the flutter assets from 1.) native code 2.) webviews. Right now, doing that requires me to copy the contents to to like a cache directory, and then I can use that file. But as you can imagine, this gets really inefficient with large files. – Dev Aggarwal Jul 15 '18 at 18:55
  • so i gave you a link in my first comment... did you try it? – pskink Jul 16 '18 at 05:53
  • I went there earlier (a couple of times), but somehow missed the "Sharing assets with the underlying platform" part – Dev Aggarwal Jul 16 '18 at 16:40

1 Answers1

1

You can access the flutter assets from native code.

See Sharing assets with the underlying platform.

Related github issue.

Dev Aggarwal
  • 7,627
  • 3
  • 38
  • 50