serialize<T> function

Map<String, dynamic> serialize<T>(
  1. T object
)

Serializes a Dart object by getting its encoder from CodableMap

You will need to initiate your custom interface first in order to serialize using this method.

Implementation

Map<String, dynamic> serialize<T>(T object) {
  final encoder = CodableMap.getEncoder<T>();
  return encoder(object);
}