title: Invalid argument(s) in Flutter
body: <p>After reinstalling my app on emulator, my console throw me this error:</p>
  <pre><code>Invalid argument(s)
  The relevant error-causing widget was
      FutureBuilder&lt;SharedPreferences&gt; 
  </code></pre>
  <p>can someone help me with this problem?
  I think, that problem is in my sharedPreferences</p>
  <pre><code>class _LanguageSelectorState extends State&lt;LanguageSelector&gt; {
    SharedPreferences sharedPreferences;
  
    static final List&lt;String&gt; languagesList = application.supportedLanguages;
    static final List&lt;String&gt; languageCodesList =
        application.supportedLanguagesCodes;
  
  
    final Map&lt;dynamic, dynamic&gt; languagesMap = {
      languagesList[0]: languageCodesList[0],
      languagesList[1]: languageCodesList[1],
    };
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
            backgroundColor: Colors.white,
            appBar: AppBar(
              backgroundColor: Colors.white,
              iconTheme: IconThemeData(color: Colors.black),
              title: Text(AppTranslations.of(context).text(&quot;settings_language&quot;), style: TextStyle(color: Colors.black, letterSpacing: 1)),
              elevation: 0.0,
              centerTitle: true,
              bottom: PreferredSize(child: Container(color: Colors.black, height: 0.1), preferredSize: Size.fromHeight(0.1),),
            ),
        body: _buildLanguagesList()
      );
    }
  
    @override
    void initState(){
      super.initState();
      getCurrentLanguage();
    }
  
    Future&lt;String&gt; getCurrentLanguage() async {
      sharedPreferences = await SharedPreferences.getInstance();
    }
  
    String selectedLanguage;
    String currentLanguage;
    bool _langOne = false;
    bool _langTwo = false;
  
  
    _buildLanguagesList() {
      return SingleChildScrollView(
        child: FutureBuilder(
          future: SharedPreferences.getInstance(),
          builder: (context, snapshot){
          return Column(
            crossAxisAlignment: CrossAxisAlignment.start,
                children: &lt;Widget&gt;[
                  Padding(
                    padding: EdgeInsets.all(20),
                    child: Text(AppTranslations.of(context).text(&quot;settings_current_language&quot;) + &quot;: &quot; + sharedPreferences.getString(&quot;currentLanguage&quot;)),
                  ),
                  CheckboxListTile(
                    title: Text(languagesList[0]),
                    value: _langOne,
                    onChanged: (value) {
                      setState(() {
                        _langOne = value;
                        sharedPreferences.setString(&quot;currentLanguage&quot;, languagesList[0]);
                        if(_langOne){
                          _langTwo = false;
                        }  
                        application.onLocaleChanged(Locale(languagesMap[languagesList[0]]));
                      });
                    },
                  ),
                  CheckboxListTile(
                    title: Text(languagesList[1]),
                    value: _langTwo,
                    onChanged: (value) {
                      setState(() {
                        _langTwo = value;
                        sharedPreferences.setString(&quot;currentLanguage&quot;, languagesList[1]);
                        if(_langTwo){
                          _langOne = false;
                        }
                        application.onLocaleChanged(Locale(languagesMap[languagesList[1]]));
                      });
                    },
                  )
                ],
              );
          }
        )
      );
    }
  }
  </code></pre>