首页 > 其他 > 详细

flutter 初探1--本机图片展示

时间:2020-06-13 09:37:29      阅读:51      评论:0      收藏:0      [点我收藏+]

1、加载本地图片:

Transform.translate(
            offset: Offset(-11.0, -73.0),
            child:
                // Adobe XD layer: ‘注册APP背景‘ (shape)
                Container(
              width: 413.0,
              height: 733.0,
              decoration: BoxDecoration(
                image: DecorationImage(
                  image: const AssetImage(‘assets/images/background.png‘),
                  fit: BoxFit.fill,
                ),
              ),
            ),
          ),

  

  1. 将图片放到assets 文件夹,分三份放好;
    1.   技术分享图片

       

       

  2. 在pubspec.yaml中配置
    1. flutter:
      
        # The following line ensures that the Material Icons font is
        # included with your application, so that you can use the icons in
        # the material Icons class.
        uses-material-design: true
        assets:
          - assets/images/background.png
          - assets/images/2.0x/background.png
          - assets/images/3.0x/background.png
      

flutter 初探1--本机图片展示

原文:https://www.cnblogs.com/hoge66/p/13111516.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!