JsonObjectMap typedef

JsonObjectMap = Map<String, Object?>

A typedef representing a JSON-encoded map with string keys and Object? values.

The JsonObjectMap type is used to represent a map-like structure commonly found in JSON-encoded data. It has string keys and Object? values, where Object? represents a nullable value of any type. This typedef is typically used to improve code readability and provide a more expressive type annotation.

Example usage:

JsonObjectMap user = {
  'name': 'John Doe',
  'age': 30,
  'email': null,
};

Note: JSON-encoded maps can contain values of different types, including null. The Object? type allows for flexibility in handling different value types.

See also:

  • Map, the built-in Dart class representing a map.
  • JsonMap, the type alias for a JSON-encoded map.

Implementation

typedef JsonObjectMap = Map<String, Object?>;