Flutter - Container onPressed?

后端 未结 6 1655
孤街浪徒
孤街浪徒 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:18

    I guess you can use GestureDetector widget like this:

    new GestureDetector(
            onTap: (){
              print("Container clicked");
            },
            child: new Container(
              width: 500.0,
              padding: new EdgeInsets.fromLTRB(20.0, 40.0, 20.0, 40.0),
              color: Colors.green,
              child: new Column(
                  children: [
                    new Text("Ableitungen"),
                  ]
              ),
            )
        );
    

提交回复
热议问题