Flutter - Container onPressed?

后端 未结 6 1656
孤街浪徒
孤街浪徒 2021-01-30 20:01

I have this container:

  new Container(
    width: 500.0,
    padding: new EdgeInsets.fromLTRB(20.0, 40.0, 20.0, 40.0),
    color: Colors.green,
    child: new C         


        
6条回答
  •  被撕碎了的回忆
    2021-01-30 20:24

    Don't use GestureDetector, it doesn't show ripple effect. Use InkWell instead.

    InkWell(
      onTap: () {}, // Handle your callback
      child: Ink(height: 100, width: 100, color: Colors.blue),
    )
    

    Output:

提交回复
热议问题