I am using the following code which clears all the shared-preferences but I just want to clear/delete particular shared-preferences value using key in a flutter.
For now, I have this which is clearing all the shared-preferences.
SharedPreferences prefrences = await SharedPreferences.getInstance(); await prefrences.clear();
You can just do this:
Dart code is pretty easy to read so sometimes when there isn’t sufficient documentation, you may just dive into code: https://github.com/flutter/plugins/blob/481e8c251667bcb28d177bfc7d295d584e703bae/packages/shared_preferences/shared_preferences/lib/shared_preferences.dart#L146
Answered By – Manish
Answer Checked By – Marie Seifert (FlutterFixes Admin)