jsonlogic 1.0.1 copy "jsonlogic: ^1.0.1" to clipboard
jsonlogic: ^1.0.1 copied to clipboard

outdated

jsonlogic is dart implementation of JsonLogic, which applies logic rules on JSON.

example/jsonlogic_example.dart

import 'package:jsonlogic/jsonlogic.dart';

void main() {
  example1();
}

void example1() {
  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('example1 answer = $answer');
}
7
likes
40
pub points
75%
popularity

Publisher

unverified uploader

jsonlogic is dart implementation of JsonLogic, which applies logic rules on JSON.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

collection

More

Packages that depend on jsonlogic