Page URL
https://dart.dev/learn/tutorial/data-and-json
Page source
https://github.com/dart-lang/site-www/blob/main/src/content/learn/tutorial/data-and-json.md
Describe the problem
In the intro of the chapter is mentioned that dart:convert and jsonDecode will be used but neither of those is used in the code in the chapter.
In the intro is mentioned:
You'll use the dart:convert library, the jsonDecode function, and pattern matching.
But the whole chapter uses this approach:
/// Returns a new [TitlesSet] instance and imports its values from a JSON map
static TitlesSet fromJson(Map<String, Object?> json) {
if (json case {
'canonical': final String canonical,
'normalized': final String normalized,
'display': final String display,
}) {
return TitlesSet(
canonical: canonical,
normalized: normalized,
display: display,
);
}
throw FormatException('Could not deserialize TitleSet, json=$json');
}
Expected fix
Either rewrite the intro to not mention dart:convert and jsonDecode, or rewrite the chapter's code examples to use them.
Additional context
No response
I would like to fix this problem.
Page URL
https://dart.dev/learn/tutorial/data-and-json
Page source
https://github.com/dart-lang/site-www/blob/main/src/content/learn/tutorial/data-and-json.md
Describe the problem
In the intro of the chapter is mentioned that
dart:convertandjsonDecodewill be used but neither of those is used in the code in the chapter.In the intro is mentioned:
But the whole chapter uses this approach:
Expected fix
Either rewrite the intro to not mention
dart:convertandjsonDecode, or rewrite the chapter's code examples to use them.Additional context
No response
I would like to fix this problem.