title: Flutter send fetched data to navigation bar item
body: <p>I have a flutter page (user) with two bottom navigation bars (user info and discussion). I go to this page via a user list and pass it the seleted user id. The page then queries the user info and then passes the user info to the user info page and discussion to the discussion page.</p>
  
  <pre><code>class UserView extends StatefulWidget {
    final String userUUID;
  
    UserView({this.userUUID});
  
    @override
    State&lt;StatefulWidget&gt; createState() {
      return _UserViewState();
    }
  }
  
  class _UserViewState extends State&lt;UserView&gt; {
    int _currentIndex = 0;
    String _userUUID;
    UserView _user;
  
    List&lt;Widget&gt; _children;
  
    @override
    void initState() {
      super.initState();
      _userUUID = widget.userUUID;
      _children = [
        UserInfo(user: _user),
        UserComments()
      ];
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text(_user.userFirstName + " " + _user.userLastName),
        ),
        body: new FutureBuilder(
          future: _getUserInfo(http.Client(), _userUUID),
          builder: (BuildContext context, AsyncSnapshot snapshot){
            if(snapshot.hasError) print(snapshot.error);
            return snapshot.hasData ?
            UserInfo(user: snapshot.data):
            Center(child: CircularProgressIndicator());
          }
        ),
        bottomNavigationBar: BottomNavigationBar(
          currentIndex: _currentIndex, // this will be set when a new tab is tapped
          items: [
            BottomNavigationBarItem(
              icon: new Icon(Icons.info),
              title: new Text('Info'),
            ),
            BottomNavigationBarItem(
              icon: new Icon(Icons.chat),
              title: new Text('Discussion'),
            )
          ],
          onTap: (int index) {
            setState(() {
              _currentIndex = index;
            });
          },
        ),
      );
    }
  }
  
  Future&lt;User&gt; _getUserInfo(http.Client client, String userUUID) async {
    final SharedPreferences prefs = await SharedPreferences.getInstance();
    Map&lt;String, String&gt; headersMap = {
      'Authorization' : 'Bearer ' + prefs.getString("TOKEN")
    };
  
    final response = await http.get(
        'https://myapi/user/view/' + userUUID,
        headers: headersMap
    );
  
    if(response.statusCode == 200) {
      return User.fromJson(json.decode(response.body));
    } else {
      throw Exception('Failed to load user data');
    }
  }
  </code></pre>
  
  <p>I am using the FutureBuilder to get the info from the API and want to pass the User object to the User Info page and Discussion list to the Discussion page.</p>
  
  <p>The response from the server looks like this:</p>
  
  <pre><code>{
      "uuid": "829998e8-6a48-4a50-a7e0-3581aeaaee87",
      "first_name": "John",
      "last_name": "Doe",
      "age": 22,
      "gender": "Male",
      "phone": "",
      "email": "",
      "created_at": "2018-10-09T00:44:04.000Z",
      "updated_at": "2018-10-09T00:44:04.000Z",
      "comments": [
          {
              "uuid": "d2c046c8-efd4-4dfa-bcef-5ee021192a7e",
              "user_uuid": "829998e8-6a48-4a50-a7e0-3581aeaaee87",
              "comment": "this is comment",
              "created_at": "2018-10-16T23:23:25.000Z",
              "updated_at": "2018-10-16T23:23:25.000Z"
          }
      ]
  }
  </code></pre>