Indeed, keep it ‘alive’ for the duration of your app. This implies having a StatefulWidget run for the duration of the application, and calling the Pref library’s init() function in that Widget’s initState() function. Then, when you ‘end’ your application, you’ll end that StatefulWidget and ‘clean up’ with that widget’s dispose() function. Calling the Prefs’ dispose() function inside there.

As for ‘best practices’, I too am working out how to best implement large apps with their many screens, etc. I hope to then contribute further articles in that pursuit. However, like most things in Life, it’s a process.

Freelance Developer

Freelance Developer