jsonata 0.1.0 copy "jsonata: ^0.1.0" to clipboard
jsonata: ^0.1.0 copied to clipboard

JSONata plugin for Flutter

JSONata plugin for Flutter

Features #

The Jsonata plugin provides functionality for querying and transforming JSON data using Jsonata expressions.

Getting started #

Permissions: As this plugin uses the latest version of jsonata from you need to enable internet permission:

Android:
    In your AndroidManifest.xml, you’ll need to include the following permission to allow internet access:
    <uses-permission android:name="android.permission.INTERNET" />

macOS /iOS:
    For macOS and iOS, you’ll need to configure entitlements. In your DebugProfile.entitlements and ReleaseProfile.entitlements files, add the following key to allow network access:

    DebugProfile.entitlements:
        <key>com.apple.security.network.client</key>
        <true/>    
    ReleaseProfile.entitlements:
        <key>com.apple.security.network.client</key>
        <true/>
    Info.plist
        <key>NSAllowsArbitraryLoads</key>
        <true/>

Usage #

The plugin allows you to extract specific information from your data by applying Jsonata queries. Here are the three alternative ways to use it:

Alternative 1: In this approach, you directly evaluate the Jsonata expression (jql) against the provided data.

var json = await Jsonata(jql).evaluate(data);

Alternative 2: Here, you create a Jsonata expression object and then evaluate it against the data.

var expression = Jsonata(jql);
var json = await expression.evaluate(data);

Alternative 3: This method involves setting the data explicitly in the Jsonata instance and then querying it with the specified expression.

var jsonata = Jsonata();
jsonata.set(data: data);
var json = await jsonata.query(jql);
1
likes
130
points
46
downloads

Publisher

verified publisherfreyt.de

Weekly Downloads

JSONata plugin for Flutter

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_inappwebview

More

Packages that depend on jsonata