title: how to pass arguments dynamically?
body: <p>I'm trying to create a button next to a title but instead of passing the content in the beginning I'm trying to do it it dynamically so I used constructors but instead of getting the values I pass when I call the constructor I keep getting null. So how can i pass arguments dynamically using constructors or any other mean? Here are the classes I'm using</p>
  
  <pre><code>class Header extends StatefulWidget {
  
  String buttonTitle;
  String title;
  
  Header(String buttonTitle , String title) //the constructor I'm gonna 
  call
  {
  this.buttonTitle = buttonTitle;
  this.title = title;
  }
  
  @override
  HeaderState createState() =&gt; HeaderState(buttonTitle , title);
  }
  
  
  class HeaderState extends State&lt;Header&gt; {
  String buttonTitle;
  String title;
  
  HeaderState(String buttonTitle , String title)
  {
  this.buttonTitle = buttonTitle;
  this.title = title;
  }
  
  @override
  Widget build(BuildContext context) {
  //some code
  Text("$title", //the first parameter passed dynamically),
  
  RaisedButton(
  child: Text(
  "$buttonTitle", //the second parameter
  ),
  }
  
  
  class FirstScreen extends StatefulWidget {
  @override
  FirstScreenState createState() =&gt; FirstScreenState();
  }  
  
  
  class FirstScreenState extends State&lt;FirstScreen&gt; {
  @override
  Widget build(BuildContext context) {
  return Scaffold(
  Header("OK", "Page1"),//constructor is called here 
  );
  }
  }
  </code></pre>