title: Cannot remove the current snackbar by calling ScaffoldState().removeCurrentSnackBar()
body: <p>For some reason i am not able to remove the current snackbar even though i am calling ScaffoldState().removeCurrentSnackBar()</p>
  
  <p>I am not getting any error messages, but for some reason the snackbar wont go away. Any other way to remove the snackbar when the user picks an item from the DropdownButton?</p>
  
  <p>I have already tried ScaffoldState().hideCurrentSnackBar() and all the other funncntions which are supposed to remove the SnackBar. </p>
  
  <p>Thank you for your answer.</p>
  
  <pre><code>class MainRoute extends StatefulWidget {
    @override
    _MainRouteState createState() =&gt; _MainRouteState();
  }
  
  class _MainRouteState extends State&lt;MainRoute&gt; {
    List&lt;Currency&gt; dropdownItems = [
      Currency(currencyName: "FOO", currencyInUSD: 22.0),
      Currency(currencyName: "BOO", currencyInUSD: 22.0),
      Currency(currencyName: "SOO", currencyInUSD: 22.0),
    ];
    Currency dropdownValue;
  
    Color color = Colors.green;
    MainModel model = MainModel();
  
    @override
    void initState() {
      super.initState();
      dropdownValue = dropdownItems[0];
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        ///A Builder has been added so the context contains the Scaffold which
        ///is required to create a SnackBar
        floatingActionButton: Builder(
          builder: (context) {
            return FloatingActionButton(
              child: Icon(
                Icons.add,
                color: kIconColor,
              ),
              onPressed: () {
                print(dropdownItems.map((item) {
                  return DropdownMenuItem(
                    value: item,
                    child: Text(item.currencyName),
                  );
                }).toList());
                setState(() {
                  Scaffold.of(context).showSnackBar(
                    SnackBar(
                      content: Column(
                        mainAxisSize: MainAxisSize.min,
                        children: &lt;Widget&gt;[
                          Text('Which currency do you want to add to your list?'),
                          SizedBox(
                            height: 25.0,
                          ),
                          DropdownButton&lt;Currency&gt;(
                            items: dropdownItems
                                .map&lt;DropdownMenuItem&lt;Currency&gt;&gt;((item) {
                              return DropdownMenuItem(
                                value: item,
                                child: Text(item.currencyName),
                              );
                            }).toList(),
                            value: dropdownValue,
                            onChanged: (value) {
                              setState(() {
                                dropdownValue = value;
                                ScaffoldState().removeCurrentSnackBar(
                                    reason: SnackBarClosedReason.remove);
                                print("SnackBar removed");
                              });
                            },
                          )
                        ],
                      ),
                      action: SnackBarAction(
                        label: 'Cancel',
                        onPressed: () {
                          print('Cancel');
                        },
                      ),
                    ),
                  );
                });
              },
            );
          },
        ),
      );
    }
  } 
  </code></pre>