dart_json_mapper_built 1.0.1 copy "dart_json_mapper_built: ^1.0.1" to clipboard
dart_json_mapper_built: ^1.0.1 copied to clipboard

This is a dart-json-mapper complementary package provides support for https://pub.dev/packages/built_collection types in order to serialize / deserialize them from / to JSON.

example/example.dart

library json_mapper_fixnum.example;

import 'package:built_collection/built_collection.dart';
import 'package:dart_json_mapper/dart_json_mapper.dart'
    show JsonMapper, jsonSerializable;
import 'package:dart_json_mapper_built/dart_json_mapper_built.dart'
    show builtAdapter;

import 'example.mapper.g.dart' show initializeJsonMapper;

@jsonSerializable
class ImmutableClass {
  final BuiltList<int> list;

  const ImmutableClass(this.list);
}

void main() {
  initializeJsonMapper(adapters: [builtAdapter]);

  print(JsonMapper.serialize(ImmutableClass(BuiltList.of([1, 2, 3]))));
}
1
likes
130
points
108
downloads

Publisher

verified publisheredensapple.com

Weekly Downloads

This is a dart-json-mapper complementary package provides support for https://pub.dev/packages/built_collection types in order to serialize / deserialize them from / to JSON.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

built_collection, dart_json_mapper

More

Packages that depend on dart_json_mapper_built