Closed TheoLassonder closed 11 months ago
It's just so convenient to be able to set a string to null to mean "remove the value". It's also what shared_preferences package does.
shared_preferences
Instead of code like:
if (from == null) { await prefs.remove('epochFrom'); } else { await prefs.setInt('epochFrom', from.millisecondsSinceEpoch); }
you can write:
await prefs.setInt('epochFrom', from?.millisecondsSinceEpoch);
Best of all, this feature can be added with backwards compatibility.
This might help https://www.youtube.com/watch?v=WN3g1YZswrA
Hi! This feature is already supported. I will update the example adding a Reset button to the counter. Thanks! 🙂
It's just so convenient to be able to set a string to null to mean "remove the value". It's also what
shared_preferences
package does.Instead of code like:
you can write:
await prefs.setInt('epochFrom', from?.millisecondsSinceEpoch);
Best of all, this feature can be added with backwards compatibility.