Encodes a value to a map.
This is a typed wrapper around the toValue method.
Map<String, dynamic> toMap<T>(T object);