Search code examples
flutterdartassets

How can I delete assets specified in pubspec.yaml in flutter?


In my flutter app, I need an asset just for the first start of the app and want to delete it afterwards. Is that possible?

I'm primarily using flutter for Android, so a platform specific answer would also be appreciated, if it's not possible to do with Dart Code.


Solution

  • It's impossible currently.

    The rootBundle contains the resources that were packaged with the application when it was built. To add resources to the rootBundle for your application, add them to the assets subsection of the flutter section of your application's pubspec.yaml manifest.

    It's packaged with the app on build time, and it can't be modified.