How to convert DateTime object to json? It throws Converting object to an encodable object failed., so is this a bug or it\'s just dart
DateTime
Converting object to an encodable object failed.
dart
You could also just convert your map in Dart.
Map encodeMap(Map map) { map.forEach((key, value) { if (value is DateTime) { map[key] = value.toString(); } }); return map; }
Usage: var _map = encodeMap(_data);
var _map = encodeMap(_data);