json_getter 0.0.2 copy "json_getter: ^0.0.2" to clipboard
json_getter: ^0.0.2 copied to clipboard

A useful Flutter package tool to extract values from JSON.

JsonGetter #

This package is a useful Flutter tool to extract values from JSON.

Features #

  • Easily extract values from JSON structures.
  • Support for multiple filters to refine data extraction.

Getting started #

To use this package, ensure you have Flutter installed and add the package to your pubspec.yaml.

  1. Add the package to your pubspec.yaml file:
dependencies:
  json_getter: ^0.0.1
  1. Import the package in your Dart file:
import 'package:json_getter/json_getter.dart';

Usage #

With JSON String #

const jsonString = '{"key1": "value1", "key2": "value2"}';
final filters = FiltersMapper.fromJson(
    '{"filters":[{"selectorType":"getValueByKey","filterBy":null,"key":"key1","operator":null,"value":null}]}',
);

final result = JsonGetter.get(filters: filters, json: jsonString);
print(result); // Output: value1

With JSON Map #

const jsonString = {'key1': 'value1', 'key2': 'value2'};
final filters = Filters(
  filters: [
    const Filter(
      selectorType: SelectorType.getValueByKey,
      key: 'key1',
    ),
  ],
);

final result = JsonGetter.get(filters: filters, json: jsonString);
print(result); // Output: value1

Demo #

image
info

Example #

Json Getter Builder

Additional information #

For more information, visit the GitHub repository.

License #

MIT License

0
likes
160
points
36
downloads

Publisher

unverified uploader

Weekly Downloads

A useful Flutter package tool to extract values from JSON.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dart_mappable, flutter

More

Packages that depend on json_getter