in_app_messaging_json_logic 2.1.1 copy "in_app_messaging_json_logic: ^2.1.1" to clipboard
in_app_messaging_json_logic: ^2.1.1 copied to clipboard

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

In-app Messaging - Json Logic #

This is extended fork of jsonlogic

JsonLogic not actively maintained, so I've created this fork to maintain it and add some features that are not included in the original package.

JsonLogic #

Jsonlogic is dart package that evaluates the json logic rules(logic) with the give data.

This is a dart port for the JSON logic javascript package.

It passes the compliance tests for the JSON logic tests.

Usage:

Sample example from jsonlogic website.

The pie isn’t ready to eat unless it’s cooler than 110 degrees, and filled with apples.

This can be encoded in the following JSON logic rule.

  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');
0
likes
150
points
107
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

collection, version

More

Packages that depend on in_app_messaging_json_logic