列(子列:[列表平铺(视觉密度:视觉密度(水平:0,垂直:3),内容填充:const EdgeInsets.对称(水平:0.0,垂直:0.0),//内容填充:仅边缘插入(左:0.0,右侧:0.0),
leading: IconButton(
onPressed: (){},
icon:const Icon(Icons.location_on_outlined,size: 40,) ),
title: GestureDetector(
onTap: (){
},
child: const Text("PICK UP",style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w500,
color:Color.fromARGB(255, 152, 182, 55)
),)
),
subtitle:const Text("Mysore,",style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Colors.black
),),
),
ListTile(
visualDensity: VisualDensity(horizontal: 0, vertical: 3),
contentPadding: const EdgeInsets.symmetric(horizontal: 0.0, vertical:0),
leading: IconButton(
onPressed: (){},
icon:const Icon(Icons.location_on_outlined,size: 40,) ),
title: GestureDetector(
onTap: (){
},
child: const Text("DROP OFF",style: TextStyle(
fontSize: 19,
fontFamily: "Ubuntu",
fontWeight: FontWeight.w500,
color:Color.fromARGB(255, 152, 182, 55)
),)
),
subtitle:const Text("Bangalore,",style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Colors.black
),),
)
],
),
我在列中添加了两个列表块,但两个列表块之间没有空格
3条答案
按热度按时间ca1c2owp1#
ffdz8vbo2#
可以使用
contentPadding
属性删除填充,将此属性设置为零ohtdti5x3#
你可以用sizedbox Package 你的列表或者在视觉密度上使用负值