Skip to content

Instantly share code, notes, and snippets.

@joe776
Created March 28, 2019 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joe776/0bf3d37cc6773abf233843556af973a4 to your computer and use it in GitHub Desktop.
Save joe776/0bf3d37cc6773abf233843556af973a4 to your computer and use it in GitHub Desktop.
import 'dart:convert';
void main() {
print(json.encode([null]));
print(json.encode(double.nan, toEncodable: (_) => 'NaN'));
print(json.encode([double.nan], toEncodable: (_) => 'NaN'));
print(json.encode({'foo': [double.nan]}, toEncodable: (_) => null));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment