Issue
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 Column(
children: [
new Text("Ableitungen"),
]
),
),
When the user clicks on the Container
, I want an onPressed()
method to be fired (like it can be done with IconButton
for example). How can I achieve this behaviour with Container
?
Solution
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"),
]
),
)
);
Answered By - guest3523
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.