serializeToMapExpression method

  1. @override
String serializeToMapExpression(
  1. String mapExpression,
  2. DartType keyType,
  3. DartType valueType,
  4. bool isMapExpressionNullable,
)

Serialize your custom map implementation to a standard Map.

Given mapExpression, which a String that evaluates to your custom map implementation T not that if isMapExpressionNullable is true, that mapExpression is nullable and you need null safe accessors

Example: if your custom map implementation has a method .toMap(), implement this method like this:

String serializeToMap(String mapExpression, DartType keyType,
      DartType valueType, bool isMapExpressionNullable){
         final optionalQuestion = isMapExpressionNullable ? '?' : '';
         return mapExpression + optionalQuestion + '.toMap()';
}

Implementation

@override
String serializeToMapExpression(String mapExpression, DartType keyType,
    DartType valueType, bool isMapExpressionNullable) {
  return mapExpression;

  /// [ObservableMap] has MapMixin this should be enough?
}