Is there a way for loading images from local storage to the backgroundImage property of the CircleAvatar widget in Flutter?

224

I believe the ImageProvider you are looking for is FileImage. You will only need to pass it the file from local storage. Here are the official docs:

https://api.flutter.dev/flutter/painting/FileImage-class.html

Share:
224
Admin
Author by

Admin

Updated on December 21, 2022

Comments

  • Admin
    Admin over 1 year

    I'm having a hard time reading the Flutter doc for the CircleAvatar widget trying to figure out what type is the backgroundImage exactly is.

    As far as I know, this property is of ImageProvider type and it can be one of the Asset classes as they extends the ImageProvider.

    I came to the conclusion that the only way to get images is via a url or a predefined assets folder.

    I want to load images from local storage. I'm currently experimentng this on Android 10.

    PLEASE, tell me there is a way to do that.