I am creating flutter desktop app with local mysql database. How to do secure the db creds so that it is not easily accesible. Is there a secure way to store db credentials?
I am creating flutter desktop app with local mysql database. How to do secure the db creds so that it is not easily accesible. Is there a secure way to store db credentials?
2
Answers
You can do this by calling the getInstance() method: SharedPreferences prefs = await SharedPreferences. getInstance(); Once you have an instance of SharedPreferences , you can use it to store data using the set method.
Prateek’s answer is fine for non secret items, but not for credentials. In windows, shared preferences are stored as plain text in your appData folder. With credentials you should look for: https://pub.dev/packages/flutter_secure_storage
You will find examples there.