Skip to content
pubscout

jsonlogic

2.0.2, released 5 years ago by an unverified publisher

Dart implementation of JsonLogic to evaluate JSON logic rules.

WASM-ready
$ flutter pub add jsonlogic
Source repository

What it does

Evaluates JSON Logic expressions against supplied data. Provides a Jsonlogic class with an apply method. Fully null‑safe and passes the official compliance tests.

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

Use it when

  • you need a lightweight rule engine for feature flags or business logic
  • you want to evaluate JSON‑based decision rules without a backend

Skip it when

  • high‑performance or compiled‑rule scenarios
  • need a UI‑focused solution or extensive rule authoring tools

Strengths

  • tiny dependency footprint (only collection)
  • null safety and thorough test coverage
  • compatible with all Flutter platforms

Weaknesses

  • limited to JsonLogic only, no code‑generation or UI helpers
  • no built‑in rule authoring UI

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
var jl = Jsonlogic();
var rule = {"and":[{"<":[{"var":"temp"},110]},{"==":[{"var":"pie.filling"},"apple"]}]};
var data = {"temp":100,"pie":{"filling":"apple"}};
var answer = jl.apply(rule, data);
print('example answer = $answer');

Alternatives

Packages that do the same job and could replace jsonlogic.

  • json_schema

    Validate JSON data against JSON Schema drafts in Dart.

  • json_patch

    Pure Dart utility package for the JSON Patch standard to apply patches and perform diffs.

  • jmespath

    Dart implementation of JMESPath, a query language for JSON documents.