notify method

Future<bool> notify(
  1. AtKey key,
  2. String value,
  3. OperationEnum operation,
  4. Function onDone,
  5. Function onError,
)

Returns true on notifying key with value, operation.

Implementation

Future<bool> notify(AtKey key, String value, OperationEnum operation,
    Function onDone, Function onError) async {
  var notificationResponse = await AtClientManager.getInstance()
      .atClient
      .notificationService
      .notify(_getNotificationParams(key, value, operation))
      .timeout(Duration(seconds: AppConstants.responseTimeLimit),
          onTimeout: () => _onTimeOut());

  return notificationResponse.notificationStatusEnum ==
      NotificationStatusEnum.delivered;
}