sendToFrontend method

void sendToFrontend(
  1. int? id,
  2. Map? result
)

Implementation

void sendToFrontend(int? id, Map? result) {
  String data = jsonEncode({
    if (id != null) 'id': id,
    // Give an empty object for response.
    'result': result ?? {},
  });
  _ws?.add(data);
}