'How can i assign local image to avatar source using flutter avatar package

I'm trying to make flutter app that contain list of persons. Then foreach person i'm expected draw avatar using 'flutter avatars package'. I have a local list of image in my app then a want display them in avatar component.

child: Avatar(
   name: '${person.firstname} ${person.lastname}',
   shape: AvatarShape.circle(20),
   sources: [
      /*I don't know how add local image element to source*/                
   ],
)


Solution 1:[1]

You have to add the imaged to pubspec.yaml under

assets:
 assets/image.jpg

and then go to the doc for the packaged and it will show you have to add a local image like so if its from the right package

child: Avatar(
   name: '${person.firstname} ${person.lastname}',
   shape: AvatarShape.circle(20),
   sources: [
     GenericSource(image: AsssetImage('assets/image.jpg')              
   ],
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 flutterloop