writeRef method

String writeRef(
  1. ClassElement e
)

Implementation

String writeRef(ClassElement e) {
  final buf = StringBuffer();
  buf.writeln('final $collectionRefTypeName $refName = FirebaseFirestore.instance');
  buf.writeln('.collection(\'$collectionName\')');
  buf.writeln('.withConverter<$className>(');
  buf.writeln('fromFirestore: $fromMapFuncName,');
  buf.writeln('toFirestore: $toMapFuncName,');
  buf.writeln(');');
  return buf.toString();
}