title: Flutter firestore shared preference double type data issue
body: <p>In my flutter app, When users sign up and I need to save double type &quot;height&quot; data and I am using <code>SharedPreferences</code> for this but I have an issue.</p>
  <p>This is my <code>SharedPreferences</code> code:</p>
  <pre><code>static Future&lt;bool&gt; saveUserWeightSharedPreference(double userWeight) async {
      SharedPreferences prefs = await SharedPreferences.getInstance();
      return await prefs.setDouble(sharedPreferenceUserLoggedInKey, userWeight);
  }
  </code></pre>
  <p>and this is my sign up function where is my using <code>SharedPreferences</code>. The error is:</p>
  <blockquote>
  <p>The argument type 'String' can't be assigned to the parameter type
  'double'. (argument_type_not_assignable at [spor3]
  lib\login\signup.dart:52)</p>
  </blockquote>
  <pre><code>  signMeUp(){
  
      if(formKey.currentState.validate()){
  
        Map&lt;String, String&gt; userInfoMap = {
          &quot;name&quot;:userNameTextEditingController.text,
          &quot;email&quot;: emailTextEditingController.text,
          &quot;height&quot;: heightTextEditingController.text,
          &quot;weight&quot;: weightTextEditingController.**text**, // this &quot;text&quot; codes not working
          &quot;weightTwo&quot;: weightTwoTextEditingController.text,
        };
  
        HelperFunctions.saveUserEmailSharedPreference(emailTextEditingController.text);
        HelperFunctions.saveUserEmailSharedPreference(userNameTextEditingController.text,);
        HelperFunctions.saveUserHeightSharedPreference(heightTextEditingController.text,);
        HelperFunctions.saveUserWeightSharedPreference(weightTextEditingController.**text**,);// and this 
        &quot;text&quot; codes not working
        HelperFunctions.saveUserWeightTwoSharedPreference(weightTwoTextEditingController.text,);
  
  
  
  
        setState(() {
          isLoading = true;
        });
        authMethods.signUpWithEmailAndPassword(emailTextEditingController.text, passwordTextEditingController.text).then((val){
  
  
  
          databaseMethods.uploadUserInfoTwo(userInfoMap);
          HelperFunctions.saveUserLoggedInSharedPreference(true);
          Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) =&gt; MainPage()));
        });
      }
    }
  </code></pre>
  <p>EDIT 1: I changed my signMeUp() function but this time I have another issue</p>
  <pre><code>signMeUp(){
  
  
  if(formKey.currentState.validate()){
  
    Map&lt;String, dynamic&gt; userInfoMap = {
      &quot;name&quot;:userNameTextEditingController.text,
      &quot;email&quot;: emailTextEditingController.text,
      &quot;height&quot;: heightTextEditingController.text,
      &quot;weight&quot;: double.parse(weightTextEditingController.text),
      &quot;weightTwo&quot;: weightTwoTextEditingController.text,
    };
  
    HelperFunctions.saveUserEmailSharedPreference(emailTextEditingController.text);
    HelperFunctions.saveUserEmailSharedPreference(userNameTextEditingController.text,);
    HelperFunctions.saveUserHeightSharedPreference(heightTextEditingController.text,);
    HelperFunctions.saveUserWeightSharedPreference(double.parse(weightTextEditingController.text),);
    HelperFunctions.saveUserWeightTwoSharedPreference(weightTwoTextEditingController.text,);
  
    
    setState(() {
      isLoading = true;
    });
    authMethods.signUpWithEmailAndPassword(emailTextEditingController.text, passwordTextEditingController.text).then((val){
  
      
      databaseMethods.uploadUserInfoTwo(userInfoMap);
      HelperFunctions.saveUserLoggedInSharedPreference(true);
      Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) =&gt; MainPage()));
    });
  }
  }
  </code></pre>
  <p>issue:</p>
  <blockquote>
  <p>The following FormatException was thrown while handling a gesture:
  Invalid double</p>
  </blockquote>
  <blockquote>
  <p>When the exception was thrown, this was the stack:
  #0      double.parse (dart:core-patch/double_patch.dart:111:28)</p>
  </blockquote>