serializerDefinitionCode function
Implementation
String serializerDefinitionCode(
String typeName, {
required bool hasFrezzed,
String? constructorName,
}) {
final _constructorName = constructorName ?? typeName;
final prefix = hasFrezzed ? '_\$' : '_';
return '''
final ${ReCase(typeName).camelCase}$serializerSuffix = SerializerValue<$typeName>(
key: "$typeName",
fromJson: (ctx, json) => $typeName.fromJson(json), // $prefix\$${_constructorName}FromJson,
// toJson: (m) => $prefix\$${_constructorName}ToJson(m as ${hasFrezzed ? '_\$' : ''}$_constructorName),
);
''';
}