We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if (SpUtil.getBool('key_test', defValue: true)) { SpUtil.putBool('key_test', false); //虽然设置成false ,但是下次还会执行进来 }
看了下源码
static bool getBool(String key, {bool defValue = false}) { if (_prefs == null) return defValue; return _prefs.getBool(key) ?? defValue; }
可能需要做以下修改
static bool getBool(String key, {bool defValue = false}) { if (_prefs == null || _prefs.getBool(key) == null) return defValue; return _prefs.getBool(key); }
The text was updated successfully, but these errors were encountered:
A ?? B, ??的意思就是,前面A为null就使用B的值
Sorry, something went wrong.
你是对的,好像每次hot reload后,值就会被清空了。
No branches or pull requests
看了下源码
可能需要做以下修改
The text was updated successfully, but these errors were encountered: