deserializeFromMapExpression method

  1. @override
String deserializeFromMapExpression(
  1. String mapExpression,
  2. DartType keyArg,
  3. DartType valueArg
)

Deserialize your custom map from an expression, that evaluates to an Iterable

Return a string, which is an expression that evaluates to your custom map implementation. Example: if your custom map implementation has a constructor MyMap.of(Map m), implement this method like this:

 String deserializeFromMapExpression(String mapExpression, DartType keyArg, DartType valueArg) {
   final prefix = 'MyMap.of';
   return '$prefix($mapExpression)';
  }

Implementation

@override
String deserializeFromMapExpression(
    String mapExpression, DartType keyArg, DartType valueArg) {
  final prefix =
      'ObservableMap<${keyArg.getDisplayString(withNullability: true)},${valueArg.getDisplayString(withNullability: true)}>.of';
  return '$prefix($mapExpression)';
}