title: Passing a value to the floating action button to be used in the bottom sheet
body: <p>In this widget the tabs navigate between types if it is question it goes a specified screen. If it is forum it goes to another one. The problem is I need to pass the type of the current tap to the on pressed function in the floating action button. However Floating action button is outside the body of the scaffold . Is there is way to pass a value to the floating action button ? </p>
  
  <pre><code>
  class TabScreen extends StatelessWidget {
  
    final GlobalKey&lt;ScaffoldState&gt; _scaffoldKey = new GlobalKey&lt;ScaffoldState();
    @override
    Widget build(BuildContext context) {
      final bool showfab = MediaQuery.of(context).viewInsets.bottom == 0.0;
      final AuthService authService = Provider.of&lt;AuthService&gt;(context);
   return StreamBuilder&lt;List&lt;String&gt;&gt;(
                stream: forumServices.forumsTypes$,
                builder: (context, snapshot) {
                  if (!snapshot.hasData) {
                    return CircularProgressIndicator();
                  }
                  List&lt;String&gt; types = snapshot.data;
                  num tabLen = types.length;
  
                  return DefaultTabController(
                      length: tabLen,
                      child: Scaffold(
                        key: _scaffoldKey,
  
                        body: CustomScrollView(slivers: &lt;Widget&gt;[
                          SliverAppBar(
                            title: Text("kdkdkkd"),
                            bottom: TabBar(
                                tabs: types.map((String f) {
                              return Text(f);
                            }).toList()),
                          ),
                          SliverFillRemaining(
                            child: StreamBuilder&lt;List&lt;Forums&gt;&gt;(
                                stream: forumServices.forums$,
                                builder: (context, snap) {
                                  if (!snap.hasData) {
                                    return CircularProgressIndicator();
                                  }
                                  final forum = snap.data;
                                  return TabBarView(
                                    children: types.map((String type) {
                                      List&lt;Forums&gt; listofthistype =
                                          forum.where((Forums fo) {
                                        return fo.type == type;
                                      }).toList();
  
                                      final cards = listofthistype
                                          .map((thistype) =&gt; ForumCard(
                                                choosentype: thistype,
                                                forumServices: forumServices,
                                              ))
                                          .toList();
  
                                      return ListView(
                                        children: cards,
                                      );
                                    }).toList(),
                                  );
                                }),
                          ),
                        ]),
                        floatingActionButton:
                          FloatingActionButton(
                                onPressed: () =&gt; _showBottom(),
                                tooltip: 'Increment',
                                child: Icon(Icons.add),
                              )
  
                      ));
                });
  </code></pre>