Simply don’t. Don’t call Prefs.init() or Prefs.dispose(). However, that means you can then only use the ‘Future’ versions of the many preference functions. Eg.
var this = Prefs.getStringF(‘this’);
var that = Prefs.getBoolF(‘that’);

The init() function stores an instance of the class, SharedPreferences, making it a bit more efficient when retrieving values (e.g. Prefs.getInt(‘month’);). Instead the ‘await’ command is used every time to get an instance, but… it’s not that bad, and provides you a solution.

Freelance Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store