flutter_background_service icon indicating copy to clipboard operation
flutter_background_service copied to clipboard

SharedPreference

Open Denish-Borad opened this issue 3 years ago • 3 comments

Can't use Shared Preferences inside it. can anyone please help how can i use sharedpref inside it

Denish-Borad avatar Aug 10 '21 09:08 Denish-Borad

You can use but, dart codes are isolated. So it means that you will working on memory, not disk. Check that: https://hackernoon.com/an-introduction-to-dart-code-and-isolate-em3j34u1

huseyinemreuslu avatar Oct 13 '21 15:10 huseyinemreuslu

You can, just do

pref.reload();

before reading or writing.

EmanueleVinci avatar Nov 19 '21 16:11 EmanueleVinci

pref.reload(); solution is perfect solution. Thank you @EmanueleVinci

bhautikcoretus avatar Jun 10 '22 07:06 bhautikcoretus