json_data 0.0.1 copy "json_data: ^0.0.1" to clipboard
json_data: ^0.0.1 copied to clipboard

json converter

example/lib/main.dart

import 'package:json_data/json_data.dart';

class Example {
  testToJsonString() {
    print(JsonData.toJsonString({
      'hello': 'world',
      'list': [
        1,
        null,
        true,
        'flutter',
        false,
        [456, 654],
        {
          'deep-level': null,
          'deeper-level': {'hello': 'world'}
        }
      ]
    }));
  }

  testToJsonArrayString() {
    print(JsonData.toJsonArrayString([
      {
        'hello': 'world',
        'list': [
          1,
          null,
          true,
          'flutter',
          false,
          [456, 654],
          {
            'deep-level': null,
            'deeper-level': {'hello': 'world'}
          }
        ]
      }
    ]));
  }

  testFromJsonString() {
    print(JsonData.fromJsonString(
        '{"hello": "world", "list": [1, null, true, "flutter", false, [456, 654], {"deep-level": null, "deeper-level": {"hello": "world"}}]}'));
  }

  testFromJsonArrayString() {
    print(JsonData.fromJsonArrayString(
        '[{"hello": "world", "list": [1, null, true, "flutter", false, [456, 654], {"deep-level": null, "deeper-level": {"hello": "world"}}]}]'));
  }
}
0
likes
120
pub points
24%
popularity

Publisher

unverified uploader

json converter

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on json_data