You can not use onpressed inside of a container. Wrap your Container with GestureDectector and use onTap.