title: Clear Shared Preferences When the App is Uninstalled?
body: <p>I'm using shared preferences to store the current user's name, avatar, and a boolean for whether the user is logged in. Uninstalling the app seems to lead to a problem when re-installing. It appears related to <code>shared preferences</code> because when I log out and log back in the problem goes away. I suspect the shared preferences file is corrupted somehow and this triggers problems all over my app.</p>
  <p>So is there a way I can either clear or delete the shared preferences file upon uninstall?</p>
  <p>If it helps, here's the code for logging out;</p>
  <pre><code>Future&lt;void&gt; logOutSocial() async {
      try {
        socState();
        await socialLogin.logOutFacebook();
        await socialLogin.logOutGoogle();
        await socialLogin.logOutTwitter();
  
        currentname = &quot;Anonymous&quot;;
        currentavatar = &quot;https://example.com/default.jpg&quot;;
        currentlogged = false;
        currentuserid = &quot;0&quot;;
  
        await savePreferences(
          currentname: &quot;Anonymous&quot;,
          currentavatar: &quot;https://example.com/default.jpg&quot;,
          currentlogged: false,
        );
  
        notifyListeners();
      } catch (e) {
        print(e);
      }
    }
  </code></pre>