getPropertyNames static method

List<String> getPropertyNames(
  1. dynamic obj
)

Recursively gets names of all properties implemented in specified object and its subobjects.

The object can be a user defined object, map or array. Returned property name correspondently are object properties, map keys or array indexes.

  • obj an objec to introspect. Returns a list with property names.

Implementation

static List<String> getPropertyNames(obj) {
  var propertyNames = <String>[];

  if (obj == null) {
    return propertyNames;
  } else {
    var cycleDetect = [];
    _performGetPropertyNames(obj, null, propertyNames, cycleDetect);
    return propertyNames;
  }
}