Problem: Shared preference bool value is null on startup even though I have given it a value if prefs.getBool(\'myBool\') returns null
null
prefs.getBool(\'myBool\')
For any one still experiencing this issue, it's because there is still a race condition in the accepted answer.
To fix it, use this package to wait for the layout to load first