json_value 0.0.5 copy "json_value: ^0.0.5" to clipboard
json_value: ^0.0.5 copied to clipboard

outdated

using json_value,we can get the value from Json data more easily.

example/main.dart

import 'dart:io';

import 'package:json_value/json_value.dart';

void main() {
  Map<dynamic, dynamic> response = {
    'user': {'name': 'Jack', 'age': 20},
    'fruits': [
      {'name': 'apple', 'detail': 'apple is sweet'},
      {'name': 'watermelon', 'detail': 'watermelon is full of water'}
    ]
  };

  JsonValue json = JsonValue(response);

  print('user -> name : ${json['user']['name'].stringValue}');
  print('user -> age : ${json['user']['age'].numValue}');

  print('get first fruit : ${json['fruits'][0].mapObject}');

  print('Get the unknown key : ${json['product'][4].stringValue}');
}
5
likes
40
pub points
0%
popularity

Publisher

unverified uploader

using json_value,we can get the value from Json data more easily.

Homepage

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on json_value