如何前缀图像大如何设置小



如何设置前缀图像大如何设置小?

Container(
height: 40,
child: TextField(
decoration: InputDecoration(
prefixIcon: Image.asset('assets/images/search.png',width: 10,height: 10,),
fillColor: Colors.white,
filled: true,
contentPadding: EdgeInsets.symmetric(horizontal: 20),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20.0),
BorderSide()
),
hintText: "serach here",
),
),
)

使用Padding来填充图标,使图标更小。

Padding(
padding: const EdgeInsetsDirectional.all(8.0),
child: Image.asset('assets/images/search.png'),
)

最新更新