当前位置:网站首页>Flutter uses local pictures

Flutter uses local pictures

2022-06-12 00:32:00 Greater than retarded

One 、 summary

Study flutter When , When using local images, you will be prompted with errors in how to set them , There is no error , It's embarrassing to not show it again . Keep this record .

Two 、 Operation steps

 Insert picture description here
 Insert picture description here
The above figure has made it clear . It can solve the problem of ordinary pictures :
yaml To configure :

  uses-material-design: true
  assets:
    - lib/assets/images/

call :

AssetImage('lib/assets/images/icon_header.jpg')

3、 ... and 、 Reference resources

Official website connection

Four 、 doubt

Set up 2 times 3 Times the figure 2.0x 3.0x Folder , Actually, when running the mobile phone . If the path is not used 2,3 Names don't have intelligent recognition . Failed to adjust , Non actual projects are not well understood . The feeling is virtual or the code has to control itself . This is the question point. I don't understand it yet. I will update it later , You can comment on what you see and understand

原网站

版权声明
本文为[Greater than retarded]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206120029417942.html