Gia*_*ada 0 android sharedpreferences dart flutter
在我尝试热重启或重新打开应用程序后,共享首选项重置值是否正常?因为在我这样做之后我的偏好就变得无效了。
谢谢。
我通过从我的应用程序中删除此行来解决此问题:
SharedPreferences.setMockInitialValues({});
void main() {
// ignore: invalid_use_of_visible_for_testing_member
SharedPreferences.setMockInitialValues({});
runApp(MyApp());
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1225 次 |
| 最近记录: |