Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 228
Xaphann Avatar asked Sep 03 '25 03:09

Xaphann


2 Answers

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.

like image 164
Josiah Mendes Avatar answered Sep 05 '25 01:09

Josiah Mendes


Flutter stores the shared pref key-value pairs in the location Users\YOUR-USER-NAME\AppData\Roaming\com.COMPANYNAME\APPNAME\shared-preferences.json

like image 29
Abubeker Mohammed Avatar answered Sep 05 '25 01:09

Abubeker Mohammed