dispatchObject method

void dispatchObject(
  1. Map<int, Map<String, EBusItem>> map,
  2. String action, {
  3. dynamic params,
})

Implementation

void dispatchObject(Map<int, Map<String, EBusItem>> map, String action, {dynamic params}) {
  if (action.isEmptyString) {
    return;
  }
  map.forEach((objectKey, busList) {
    try {
      var bus = busList[action];
      if (bus != null) {
        if (params == null) {
          bus.method.call();
        } else {
          bus.method.call(params);
        }
      }
    } catch (e) {}
  });
}