title: Add materialRoute at the ontap function
body: <p>I try to open another page that I design on flutter but I get an error at the end of the code , at the brackets ( at the <code>onTap(){}</code>) what should I add in the brackets next to the <code>ElementPageDetail</code>? And also , why can't I add another <code>container</code> in the <code>SingleChildScrollView</code> that I created? It's because of the <code>Stack</code>? <code>Expanded</code>?</p>
  <pre><code>class _ElementMainPageState extends State&lt;ElementMainPage&gt; {
    PageController _pageController = PageController(viewportFraction: 0.7);
    double _indicatorHeight = 35.45;
    int _pageIndex = 0;
  
    List&lt;String&gt; _heroTag = [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;];
    List&lt;String&gt; _heroTextTag = List.generate(10, (index) =&gt; &quot;t$index&quot;);
  
    @override
    void initState() {
      // TODO: implement initState
      super.initState();
    }
  
    @override
    Widget build(BuildContext context) {
      Expanded(
                          flex: 8,
                          child: Stack(
                            children: [
                              Positioned(
                                left: 0,
                                right: 0,
                                bottom: 160,
                                top: 0,
                                child: Padding(
                                    padding: const EdgeInsets.all(8.0),
                                    child: SingleChildScrollView(
                                      physics: BouncingScrollPhysics(),
                                      scrollDirection: Axis.horizontal,
                                      child: GestureDetector(
                                        onTap: () {
                                          Navigator.push(
                                              context,
                                              new MaterialPageRoute(
                                                  builder: (_) =&gt;
                                                      ElementDetailPage()));
                                        },
                                        child: Container(
                                          margin: EdgeInsets.only(
                                              left: 16, right: 16, bottom: 24),
                                          decoration: BoxDecoration(
                                              boxShadow: [
                                                BoxShadow(
                                                    color: Colors.black
                                                        .withOpacity(0.2),
                                                    spreadRadius: -4,
                                                    blurRadius: 4,
                                                    offset: Offset(-4, 24))
                                              ],
                                              color: Colors.indigoAccent[700],
                                              image: DecorationImage(
                                                  image: NetworkImage(
                                                      &quot;https://i.pinimg.com/564x/f9/54/87/f95487ddee97d480f621aa27fc924443.jpg&quot;),
                                                  fit: BoxFit.cover),
                                              borderRadius:
                                                  BorderRadius.circular(24)),
                                          padding: EdgeInsets.all(16),
                                          child: Column(
                                            crossAxisAlignment:
                                                CrossAxisAlignment.start,
                                            children: [
                                              Spacer(),
                                              Container(
                                                height: 48,
                                                width: 48,
                                                decoration: BoxDecoration(
                                                    color: Colors.white
                                                        .withOpacity(0.5),
                                                    borderRadius:
                                                        BorderRadius.circular(8)),
                                                child: Center(
                                                  child: Text(
                                                    &quot;20&quot;,
                                                    style: TextStyle(
                                                        fontWeight:
                                                            FontWeight.bold,
                                                        color: Colors.white,
                                                        fontSize: 18),
                                                  ),
                                                ),
                                              ),
                                              SizedBox(
                                                height: 8,
                                              ),
                                              Text(
                                                &quot;questions to adress&quot;,
                                                style: TextStyle(
                                                  fontSize: 16,
                                                  color: Colors.white,
                                                ),
                                              ),
                                              Text(
                                                &quot;Unknown Stage&quot;,
                                                style: TextStyle(
                                                  fontSize: 24,
                                                  color: Colors.white,
                                                  fontWeight: FontWeight.bold,
                                                ),
                                              )
                                            ],
                                          ),
                                        ),
                                      ),
                                    ))
  </code></pre>
  <p>And the ElementDetailPage</p>
  <pre><code>import 'package:flutter/material.dart';
  
  class ElementDetailPage extends StatefulWidget {
    String imageTag;
  
    String titleTag;
  
    ElementDetailPage(this.imageTag, this.titleTag);
  
    @override
    _ElementDetailPageState createState() =&gt; _ElementDetailPageState();
  }
  
  class _ElementDetailPageState extends State&lt;ElementDetailPage&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Stack(
          children: [
            Positioned(
                left: 0,
                right: 0,
                top: 0,
                bottom: 0,
                child: Hero(
                  tag: widget.imageTag,
                  child: Container(
                    decoration: BoxDecoration(
                        image: DecorationImage(
                            image: NetworkImage(
                                &quot;https://i.pinimg.com/564x/f9/54/87/f95487ddee97d480f621aa27fc924443.jpg&quot;),
                            fit: BoxFit.cover)),
                    padding: EdgeInsets.only(left: 24),
                    child: ListView(
                      children: [
                        SizedBox(
                          height: 100,
                        ),
                        Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Container(
                              height: 64,
                              width: 64,
                              decoration: BoxDecoration(
                                  color: Colors.white.withOpacity(0.5),
                                  borderRadius: BorderRadius.circular(8)),
                              child: Center(
                                child: Text(
                                  &quot;20&quot;,
                                  style: TextStyle(
                                      fontWeight: FontWeight.bold,
                                      color: Colors.white,
                                      fontSize: 18),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox(
                          height: 8,
                        ),
                        Text(
                          &quot;questions to adress&quot;,
                          style: TextStyle(
                            fontSize: 18,
                            color: Colors.white,
                          ),
                        ),
                        Text(
                          &quot;Unknown stage&quot;,
                          style: TextStyle(
                            fontSize: 64,
                            color: Colors.white,
                            fontWeight: FontWeight.bold,
                          ),
                        ),
                        Text(
                          &quot;&quot;
                          &quot;Unknown stage is the first fase to know somebody new.&quot;
                          &quot; It is the easiest stage to see if you like the person in front of you &quot;
                          &quot;and if you want to continue forming a bound with them to become friends or&quot;
                          &quot;\n if there aren't your type of a person and let them go.This question will have some &quot;
                          &quot; basic questions and some intimate questions, if somebody wants to skip a question i propose a shot&quot;
                          &quot; \n WARNING : You may fall in love&quot;,
                          style: TextStyle(color: Colors.white),
                        ),
                      ],
                    ),
                  ),
                )),
            Positioned(
                left: 16,
                top: 32,
                child: IconButton(
                  icon: Icon(Icons.arrow_back),
                  color: Colors.white,
                  onPressed: () {
                    Navigator.of(context).pop();
                  },
                )),
            Positioned(
                top: 600,
                left: 100,
                child: RaisedButton(
                  onPressed: () {},
                  shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(80.0)),
                  padding: EdgeInsets.all(0.0),
                  child: Ink(
                    decoration: BoxDecoration(
                        gradient: LinearGradient(
                          colors: [Colors.white, Colors.white30],
                          begin: Alignment.centerLeft,
                          end: Alignment.centerRight,
                        ),
                        borderRadius: BorderRadius.circular(30.0)),
                    child: Container(
                      constraints:
                          BoxConstraints(maxWidth: 250.0, minHeight: 50.0),
                      alignment: Alignment.center,
                      child: Text(
                        &quot;Start playing&quot;,
                        textAlign: TextAlign.center,
                        style: TextStyle(color: Colors.black, fontSize: 15),
                      ),
                    ),
                  ),
                )),
            Positioned(
                top: 700,
                left: 100,
                child: RaisedButton(
                  onPressed: () {},
                  shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(80.0)),
                  padding: EdgeInsets.all(0.0),
                  child: Ink(
                    decoration: BoxDecoration(
                        gradient: LinearGradient(
                          colors: [Colors.black, Colors.black87],
                          begin: Alignment.centerLeft,
                          end: Alignment.centerRight,
                        ),
                        borderRadius: BorderRadius.circular(30.0)),
                    child: Container(
                      constraints:
                          BoxConstraints(maxWidth: 250.0, minHeight: 50.0),
                      alignment: Alignment.center,
                      child: Text(
                        &quot;Spotify Playlist&quot;,
                        textAlign: TextAlign.center,
                        style: TextStyle(color: Colors.white, fontSize: 15),
                      ),
                    ),
                  ),
                ))
          ],
        ),
      );
    }
  }
  </code></pre>