medito-app
medito-app copied to clipboard
Replace the usage of SharedPreferences.getInstance() with sharedPreference instance available in main.dart
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.