Stack(
children: <Widget>[
getChartView(widget.globalData.chartSelectValue),
Container(
decoration: BoxDecoration(
border: Border.all(
color: HexColor("#0C1C3B"), // <--- border color
width: 10.0,
),
),
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - 280,
)
],
),
我想要在getChartView()中单击,但是该容器位于click和chartview之间,有谁可以帮助我吗?
Stack(
children: <Widget>[
GestureDetector(
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: HexColor("#0C1C3B"),
width: 10.0,
),
),
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - 280,
),
onTap: ()
{
getChartView(widget.globalData.chartSelectValue);
},
)
],
),
InkWell(
onTap: () {
getChartView(widget.globalData.chartSelectValue);
},
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: HexColor("#0C1C3B"),
width: 10.0,
),
),
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - 280,
),
),
或者您可以使用InkWell,它可以处理轻击事件并为动作设置动画。