Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

flutter load image from assets

1. add the following codes to 【pubspec.yaml】
____________________________________________________________________________________
assets:
     - assets/xxx/xxx/xxx.jpg
____________________________________________________________________________________
2. call assets with the following code
 AssetImage('assets/xxx/xxx/xxx.jpg')
eg : CircleAvatar(
			radius: 50,
			backgroundImage: AssetImage('assets/images/app_logo/guest.jpg'),)
____________________________________________________________________________________
Source by flutter.dev #
 
PREVIOUS NEXT
Tagged: #flutter #load #image #assets
ADD COMMENT
Topic
Name
7+5 =