ToJson<E> typedef

ToJson<E> = Map<String, dynamic> Function(E object)

A function that converts an object of type E to a JSON map.

This typedef defines the signature for serialization functions used by JSON storage containers. The function receives an object of type E and returns a JSON-serializable map that can be passed to jsonEncode.

Parameters:

  • object - The object to convert to JSON format.

Returns: A map with string keys and JSON-compatible values representing the object. Values must be JSON-serializable types (String, num, bool, List, Map, or null).

Implementation

typedef ToJson<E> = Map<String, dynamic> Function(E object);