serializeToList method
convert the given expression for serialization. The expression is dart code that evaluates to your custom iterable type. you need to return an expression that evaluates to a Dart list
Note: you don't need to implement this if your type implements Iterable. you can throw an exception , this method will never be called in that case
example for kt_dart:
@override
String serializeToList(
String expression, DartType type, bool isExpressionNullable) {
final optionalQuestion = isExpressionNullable ? '?' : '';
return expression + optionalQuestion + '.iter.toList()';
}
Implementation
@override
String serializeToList(String expression, DartType resolvedGenericType,
bool isExpressionNullable) {
///not needed as ObservableList is Iterable, so it's handled by the default TypeHelper
throw UnimplementedError();
}