justsink
justsink
发布于 3个月前

flutter Container 图片背景

Container(
  width: 150.0,
  height: 150.0,
  decoration: BoxDecoration(
    image: DecorationImage(
        image: ExactAssetImage('assets/images/bg.png'),
        fit: BoxFit.cover
    ),
  ),
  child: Text('我是一个有图片背景的 Container'),
)