Search code examples
flutterdartsharedpreferences

Flutter SharedPreferences Windows location


Where does SharedPreferences save local data on Windows? Like where is the path? I am referring to this:

final prefs = await SharedPreferences.getInstance();
var myData = prefs.getString('myData');

Thanks


Solution

  • According to the Shared Preferences documentation, it's stored in the local AppData folder for Windows.

    From a scan of the code for the Windows platform interface, this seems to be the path obtained by pathProvider.getApplicationSupportPath(). You could call this in your code to get the specific path of where the file is stored.