title: Flutter how to pass value to State class
body: <p>I having trouble with passing parameter between classes. When i wanted to pass email from MyScreen classes to my TabScreen it shows:</p>
  
  <p>A [State] object's configuration is the corresponding [StatefulWidget] instance. This property is initialized by the framework before calling [initState]. If the parent updates this location in the tree to a new widget with the same [runtimeType] and [Widget.key] as the current configuration, the framework will update this property to refer to the new widget and then call [didUpdateWidget], passing the old configuration as an argument.</p>
  
  <p>Not sure how to handle this passing variables to a state class. I can use '${widget.email}' but only in widget array. Inside List tabs, I really have no idea how. Quite new to flutter way of doing things...am i doing it wrongs somewhere?</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:my_helper/tab_screen2.dart';
  import 'package:my_helper/tab_screen3.dart';
  import 'tab_screen.dart';
  
  class MainScreen extends StatefulWidget {
    final String email; //&lt;-managed to get this variable from previous screen
  
  MainScreen({Key key,this.email}) : super(key: key);
  
  @override
  _MainScreenState createState() =&gt; _MainScreenState();
  }
  
  class _MainScreenState extends State&lt;MainScreen&gt; {
   int currentTabIndex = 0;
  
  List&lt;Widget&gt; tabs = [
    TabScreen("Home", widget.email), //&lt;- ERROR this widget.email shows error "only static member can be ...."
    TabScreen2("Message"),
    TabScreen3("Profile")
  ];
  
  String $pagetitle = "Home";
  
  onTapped(int index) {
   setState(() {
    currentTabIndex = index;
   });
  }
  
  @override
  Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text($pagetitle),
    ),
    body: tabs[currentTabIndex],
    bottomNavigationBar: BottomNavigationBar(
      onTap: onTapped,
      currentIndex: currentTabIndex,
      items: [
        BottomNavigationBarItem(
          icon: Icon(Icons.search),
          title: Text("Jobs"),
        ),
        BottomNavigationBarItem(
          icon: Icon(Icons.mail),
          title: Text("Messages"),
        ),
        BottomNavigationBarItem(
          icon: Icon(Icons.person),
          title: Text("Profile"),
        )
      ],
     ),
    );
   }
  }
  </code></pre>
  
  <p>my TabScreen </p>
  
  <pre><code> import 'package:flutter/material.dart';
   import 'package:http/http.dart' as http;
  
   class TabScreen extends StatelessWidget {
   final String apptitle,email;
  
    TabScreen(this.apptitle,this.email);
  
   @override
   Widget build(BuildContext context) {
   return  Column(
     children: &lt;Widget&gt;[
       Text(email)
     ],
    );
   }
  }
  </code></pre>