packages/fancy_backgrounds/backgrounds/background1.png

The lib/ is implied,
so it should not be included in the asset path.

If you are developing a package, to load an asset within the package, specify it in the ‘pubspec.yaml’ of the package:

flutter

assets

assets/images/

To load the image within your package, use:

return

const

AssetImage

'packages/fancy_backgrounds/backgrounds/background1.png'

);

Sharing assets with the underlying platform

Flutter assets are readily available to platform code
using the AssetManager on Android and NSBundle on iOS.

Loading Flutter assets in Android

AssetManager API.  The lookup key used in,
for instance

openFd, is obtained from