title: OnPressed Parameter issue with Text
body: <pre><code>   Container(
                    height: 50.0,
                    margin: EdgeInsets.symmetric(horizontal: 60),
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(50),
                      color: Color.fromRGBO(49, 39, 79, 1),
                    ),
                    child: Center(
                        child: Text(
                          "Login", style: TextStyle(color: Colors.white),),
                        onPressed: () {
                          Navigator.push(
                            context,
                            MaterialPageRoute(builder: (context) =&gt; SecondPage()),
                          );
                        }
                    ),
                  ),
  </code></pre>
  
  <p>Hi, could someone take a look at this code? I am having issues implementing switching pages in Flutter. The parameter for onPressed is not defined. This would mean that I need to put the function on a button or not? Can't I have the function be on the container along with the text?</p>