Flutter onTap method for Containers

后端 未结 5 921
粉色の甜心
粉色の甜心 2021-02-03 17:56

Been developing a flutter app and dynamicly building some containers from some Firebase data. I wanted to know if there is a way to get a onTap method for containers (or any wi

5条回答
  •  灰色年华
    2021-02-03 18:29

    You can wrap your Container in an InkWell or GestureDetector. The difference is that InkWell is a material widget that shows a visual indication that the touch was received, whereas GestureDetector is a more general purpose widget that shows no visual indicator.

提交回复
热议问题