getAllReadProperty function

List<PropertyInducingElement> getAllReadProperty(
  1. VariableElement field
)

Implementation

List<PropertyInducingElement> getAllReadProperty(VariableElement field) {
  final type = field.type;
  if(type is! InterfaceType) {
    return [];
  }

  return [...type.accessors, ...type.allSupertypes.expand((e) => e.accessors)]
    .where((e) => e.isGetter)
    .map((e) => e.variable)
    .toList();
}