medito-app icon indicating copy to clipboard operation
medito-app copied to clipboard

Replace the usage of SharedPreferences.getInstance() with sharedPreference instance available in main.dart

Open mohit92 opened this issue 3 years ago • 0 comments

when you do SharedPref,getInstance(), it is an async function even if it returns the same instance every time. This results in a async function everytime we need to read/write data to shared prefs and becomes difficult to deal with in widgets.

now since we store this instance at first page, we don’t need to call the async getInstance method every time and can access sharedprefs in a sync manner. You can check the usage of it in markAsListened method.

mohit92 avatar Apr 20 '21 16:04 mohit92