registerSerializer<T> static method

void registerSerializer<T>(
  1. Map<String, dynamic> function(
    1. T obj
    )
)

Registers a serializer for a specific type. Needed for dynamically serializing objects. NOTE: This function is called by generated code in the target Flutter app. You should not call this function directly in your code.

Implementation

static void registerSerializer<T>(Map<String, dynamic> Function(T obj) function) {
  serializers[T] = (dynamic obj) => function(obj as T);
}