Container 或 ClipOval 上的圆形波纹效果

时间:2020-12-27 11:29:02

标签: flutter containers

我将容器的形状更改为圆形并使用 InkWell onTap 方法覆盖以添加照片。但是当点击水龙头时,涟漪效果总是显示矩形。这是我的代码。

    Widget build(BuildContext context) {
    return InkWell(
      onTap: onUploadPhoto,
      child: Container(
        width: getScreenWidthRation(120),
        height: getScreenHeightRation(120.0),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(120),
          color: Color(0xFFF5F6F9),
          //shape: BoxShape.circle,
        ),
        //ClipOval(child: Image.file(imageFile,fit: BoxFit.cover,),)
        child: imageFile != null ? CircleAvatar(backgroundImage: FileImage(imageFile),radius: 120,): Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            SvgPicture.asset(
              svgIcon,
              color: custPrimaryColor,
            ),
            SizedBox(
              height: getScreenHeightRation(5),
            ),
            Text(
              statusTxt,
              textAlign: TextAlign.center,
            ),
          ],
        ),
      ),
    );
  }

0 个答案:

没有答案