JsonMapper class Null safety

Singleton class providing mostly static methods for conversion of previously annotated by JsonSerializable Dart objects from / to JSON string

Constructors

JsonMapper()
factory

Properties

converters Map<Type, ICustomConverter>
read / write
enumValues Map<Type, dynamic>
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
typeInfoDecorators Map<int, ITypeInfoDecorator>
read / write
valueDecorators Map<Type, ValueDecoratorFunction>
read / write

Methods

info() → void
Prints out current mapper configuration to the console List of currently registered adapters and their priorities
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeAdapter(IAdapter adapter) JsonMapper
De-registers previously registered adapter using useAdapter method
toString() String
A string representation of this object. [...]
inherited
useAdapter(IAdapter adapter, [int? priority]) JsonMapper
Registers an instance of IAdapter with the mapper engine Adapters are meant to be used as a pluggable extensions, widening the number of supported types to be seamlessly converted to/from JSON

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Properties

instance JsonMapper
Private implementation area onwards /////////////////////////////////////
final

Static Methods

clone<T>(T object) → T?
Clone Dart object of type T
copy<T>(T object) → T?
Alias for clone method to copy Dart object of type T
copyWith<T>(T object, Map<String, dynamic> map) → T?
Copy Dart object of type T & merge it with Map<String, dynamic>
deserialize<T>(dynamic jsonValue, [DeserializationOptions options = defaultDeserializationOptions]) → T?
Converts JSON String Or Object to Dart object instance of type T jsonValue could be as of String type, then it will be parsed internally jsonValue could be as of Object type, then it will be processed as is
fromJson<T>(String jsonValue, [DeserializationOptions options = defaultDeserializationOptions]) → T?
Converts JSON String to Dart object of type T
fromMap<T>(Map<String, dynamic>? map, [SerializationOptions options = defaultSerializationOptions]) → T?
Converts Map<String, dynamic> to Dart object instance of type T
serialize(Object? object, [SerializationOptions options = defaultSerializationOptions]) String
Converts an instance of Dart object to JSON String
toJson(Object? object, [SerializationOptions options = defaultSerializationOptions]) String
Converts Dart object to JSON String
toMap(Object? object, [SerializationOptions options = defaultSerializationOptions]) Map<String, dynamic>?
Converts Dart object to Map<String, dynamic>