Flutter:GestureDetector在ListWheelScrollView中不起作用

时间:2020-03-27 02:01:05

标签: flutter dart gesturedetector

我没有找到错误,为什么当您按下其中一个图块时未调用选项卡上的手势。有人能帮我吗?我在做什么错了?

Widget build(BuildContext context) {
final List<Widget> questionThemes = <Widget>[];

for (int i = 0; i < numberQuestionBundels; i++) {
  questionThemes.add(GestureDetector(
    onTap: () {
      setState(() {
        print('Does not work');
        //... Navigation Method
      });
    },
    child: Container(
      alignment: Alignment.centerLeft,
      margin: const EdgeInsets.all(2.0),
      child: ListView(itemExtent: 20.0, children: <Widget>[
        Text('Thema: ' + lectionBundle.taskBundle[i].nameOfTask,
            style: textStyles.lightGrey20Creepy,
            textAlign: TextAlign.center),
        //... more Texts
      ]),
    ),
  ));
}

return ListWheelScrollView(
  itemExtent: 110,
  diameterRatio: 5,
  children: questionThemes,
);}

0 个答案:

没有答案