【发布时间】:2022-12-04 11:25:29
【问题描述】:
Minimal reproducible code:
void main() async {
final prefs = await SharedPreferences.getInstance();
await prefs.setString(\'key\', null); // Error
}
How can I set a null value in shared_preferences
Note: I\'m not looking for workarounds like, instead of null, use an empty string \'\' and then check for it.
getStringcall will returnnull