enumSerializeMethod method

String? enumSerializeMethod(
  1. String providerName
)

Implementation

String? enumSerializeMethod(String providerName) {
  if (!isEnum) return null;
  final element = (targetType as InterfaceType).element as EnumElement;
  for (final method in element.methods) {
    if (method.name == 'to$providerName') return 'to$providerName';
  }
  for (final method in element.methods) {
    if (method.name == 'toJson') return 'toJson';
  }
  return null;
}