Skip to content

Conversation

@kevmoo
Copy link
Collaborator

@kevmoo kevmoo commented Aug 1, 2017

No description provided.

preparing to enable lint: prefer_single_quotes
@kevmoo kevmoo requested a review from natebosch August 1, 2017 21:44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe break out some methods?

This is really hard to follow. Also a Doc comment would be nice

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might read easier if we don't use the else after a return. Also could optionally inline the return

if (value == null) return 'null';
if (value is String) return _jsonStringAsDart(value);
if (value is bool || value is num) {
  return value.toString();
}
if (value is List) return _jsonListAsDart(value, asConst);
if (value is Map) return _jsonMapAsDart(value, asConst);
throw ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally like closing braces...but I see your point...

Fix edge cases with String encoding in JsonLiteral generator
And add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants