Skip to content
pubscout

deep_pick

1.4.0, released 3 days ago by pascalwelsch.com

Type-safe API for manual JSON parsing with useful error messages.

WASM-readyRock solid
$ flutter pub add deep_pick
Source repository

What it does

Simplifies manual JSON parsing by replacing dynamic casts and nested null checks with a type-safe, fluent API. It supports flexible input types, fixed output types, and detailed error messages when parsing fails.

AI-written summary of version 1.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You prefer manual JSON parsing over code generation tools.
  • You want robust and clear error messages when JSON structures change unexpectedly.
  • You need to safely parse deeply nested JSON objects and lists.

Skip it when

  • You prefer automated serialization code generation for large models.
  • You are already heavily invested in serializable model classes generated via build_runner.

Strengths

  • No dynamic casting or explicit type checks needed.
  • Provides extremely helpful error messages showing where parsing failed.
  • Supports deep nested picking without boilerplate null checks.

Weaknesses

  • Requires manual writing of parsing logic and factory constructors.
  • Does not automate model generation.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:deep_pick/deep_pick.dart';

final String version = pick(json, 'latest', 'version').asStringOrThrow();

Alternatives

Packages that do the same job and could replace deep_pick.

  • pubspec_parse

    Parse pubspec.yaml files with a type‑safe API and detailed error reporting.

  • json_schema

    Validate JSON data against JSON Schema drafts in Dart.

  • fixed

    Fixed decimal numbers with a fixed scale, stored as BigInts, supporting math, formatting and parsing.

  • conduit_codable

    A library for encoding and decoding dynamic structured data like JSON and YAML into Dart objects.

Works with

Packages commonly used together with deep_pick: ones it builds on, ones built on it, and its own family.