Widget build(BuildContext context) {
return InkWell(
onTap: () {
// Handle the tap on the left side of the tile
},
child: Row(
children: [
Flexible(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text("Tile content"),
),
),
GestureDetector(
onTap: () {
// Handle the tap on the right side of the tile
},
child: Container(
width: 48.0,
height: 48.0,
child: Icon(Icons.favorite),
),
),
],
),
);
}
1条答案
按热度按时间wmomyfyw1#
您可以使用InkWell包裹整个磁贴,并使用GestureDetector小部件检测磁贴右侧的点击。
示例