lesnitsky / flutter_localstorage

📦 LocalStorage for Flutter
MIT License
299 stars 65 forks source link

Converting object to an encodable object failed: Instance of 'DateTime' #59

Closed Dahleh closed 2 years ago

Dahleh commented 3 years ago

What is the best way to save a variable of DateTime, I'm using the same example of the package but the Task object has a DateTime var

jabirmayar commented 3 years ago

you can save it as DateTime or a String as DateTime.now().millisecondsSinceEpoch.toString() or int DateTime.now().millisecondsSinceEpoch .