getPublicGettersFrom function

Map<String, DeclarationMirror?>? getPublicGettersFrom(
  1. ClassMirror classMirror
)

Get the list of public variables DeclarationMirror and setters from classMirror

Implementation

Map<String, DeclarationMirror?>? getPublicGettersFrom(ClassMirror classMirror) {
  return classMirror.getters?.fold(<String, DeclarationMirror?>{},
      (publicGetters, getter) {
    if (!getter.startsWith('_'))
      publicGetters?[getter] = classMirror.fields?[getter];
    return publicGetters;
  });
}