getProperties static method

Map<String, dynamic> getProperties(
  1. dynamic obj
)

Get values of all properties in specified object and its subobjects and returns them as a map.

The object can be a user defined object, map or array. Returned properties correspondently are object properties, map key-pairs or array elements with their indexes.

  • obj an object to get properties from. Returns a map, containing the names of the object's properties and their values.

Implementation

static Map<String, dynamic> getProperties(obj) {
  var properties = <String, dynamic>{};

  if (obj != null) {
    var cycleDetect = [];
    _performGetProperties(obj, null, properties, cycleDetect);
  }

  return properties;
}