@@ -227,8 +227,8 @@ pick(json).asMapOrEmpty<String, dynamic>();
227227
228228# # Custom parsers
229229
230- Parsers in `deep_pick` are based on extension functions on the classes `Pick` and `RequiredPick` .
231- This makes it flexible and easy for 3rd-party types to add custom parers .
230+ Parsers in `deep_pick` are based on extension functions on the classes `Pick`.
231+ This makes it flexible and easy for 3rd-party types to add custom parsers .
232232
233233This example parses a `int` as Firestore `Timestamp`.
234234` ` ` dart
@@ -290,7 +290,9 @@ final String fullName = pick(data, 'full_name').asStringOrThrow();
290290final String? level = pick(data, 'level').asIntOrNull();
291291` ` `
292292
293- ` deep_pick` offers an alternative `required()` API with the same result.
293+ ` deep_pick` offers an alternative `required()` API with the same result.
294+ This is useful to make sure a value exists before parsing it.
295+ In case it is `null` or absent a useful error message is printed.
294296
295297` ` ` dart
296298final String fullName = pick(data, 'full_name').required().asString();
@@ -391,7 +393,7 @@ final milestoneCreator = pick(json, 'milestone', 'creator', 'login').asStringOrT
391393
392394// Unhandled exception:
393395// PickException(
394- // required value at location "milestone" in pick(json, "milestone" (absent), "creator", "login") is absent.
396+ // Expected a non-null value but location "milestone" in pick(json, "milestone" (absent), "creator", "login") is absent.
395397// Use asStringOrNull() when the value may be null at some point (String?).
396398// )
397399` ` `
0 commit comments