title: How to create sharedpreferences class and use it everywhere in my flutter App
body: <p>How to do it, please give me an idea. It's like a global class which can be accessed by every other class, I actually want to build a util class so that all these things will be only there and I can call these things with just object of util class.</p>
  
  <p>Look this is how I have been doing it </p>
  
  <pre><code>SharedPreferences sharedPreferences;
  
  sharedPreferences = await SharedPreferences.getInstance();
                        sharedPreferences.setString('uwr_name', ctrUwrName.text);
                        getCredential();
  </code></pre>
  
  <p>And this getCredentail() method I have called where I want data from sharePref.but i don't know Y I need to call it at the time of Setting the data, if I won't put it at the time of setting the data to sharedpref it will give an error</p>
  
  <pre><code>getCredential() async {
    sharedPreferences = await SharedPreferences.getInstance();
  }
  </code></pre>