CircleAvatar抖动不适合圆圈内的图像

时间:2020-01-14 07:45:21

标签: user-interface flutter mobile dart

请帮助,我需要在circleAvatar小部件中放置图片,但是该图片不能完美显示。

此问题,仅在android设备上显示

enter image description here

                     return Center(
                        child: CircleAvatar(
                          radius: 100.0,
                          backgroundImage: ExactAssetImage(
                            'assets/images/ic_Photo-L.png',
                          ),
                        ),
                      );

1 个答案:

答案 0 :(得分:0)

如果不是强制性的 CircleAvatar ,请尝试使用带有容器的ClipOval

const _ = require('lodash'),
    debug = require('debug')('update'),
    Promise = require('bluebird')

const asset = require('../models/asset'),
    equipments = require('../models/equipments')

const Equipment = asset.getEquipment(),
    my_equipments = equipments.get_equipments(),
    icons = equipments.get_icons()

Promise.resolve()
.then(() => {

    debug('Retrieve asset equipments, icons')
    return Promise.all([
        icons.findAll(),
        Equipment.find({ icon_name: { $ne: null } })
    ])
})
.then(([my_icons, asset_equipments]) => {
    debug('Update equipments')
    const updates = []

    console.log(asset_equipments.length)
    asset_equipments.forEach((aeq, i) => {

        const icon_id = my_icons.find(icon => icon.name === aeq.icon_name).id
            up = my_equipments.update(
                { icon_id },
                { where: { code: aeq.eq_id } }
            )

        updates.push(up)
    })


    return Promise.all(updates)
})
.then(() => {
    debug('Success: all done')
    asset.close()
    equipments.close()
})
.catch(err => {
    debug('Error:', err)
    asset.close()
    equipments.close()
})