title: Flutter how to print value pass through screen?
body: <p>I am passing value between 2 screens I need to know how can I simply print value? </p>
  
  <p>This is how I am sending value</p>
  
  <pre><code>onTap: () {
        Navigator.push(
          context,
              MaterialPageRoute(
                   builder: (_) =&gt; ViewPostScreen(
                     id: id,
                    ),
                   ),
                 );
              },
  </code></pre>
  
  <p>This is my second page</p>
  
  <pre><code>class ViewPostScreen extends StatefulWidget {
    final int id;
    ViewPostScreen({Key key, @required this.id}) : super(key: key);
  
    @override
    _ViewPostScreenState createState() =&gt; _ViewPostScreenState();
  }
  
  class _ViewPostScreenState extends State&lt;ViewPostScreen&gt; {
  }
  </code></pre>
  
  <p>I need to print the value of <code>id</code> in <code>_ViewPostScreenState</code> I try with simple print but showing error anyone can help?</p>
  
  <p><a href="https://i.stack.imgur.com/JEW6W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JEW6W.png" alt="enter image description here"></a></p>