updatePushDisplayStyle method Null safety

Future<void> updatePushDisplayStyle(
  1. DisplayStyle displayStyle
)

Updates the push message style. The default value is {@link DisplayStyle#Simple}.

Param displayStyle The push message display style.

Throws A description of the issue that caused this exception. See {@link EMError}

Implementation

Future<void> updatePushDisplayStyle(DisplayStyle displayStyle) async {
  Map req = {'pushStyle': displayStyle == DisplayStyle.Simple ? 0 : 1};
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.updateImPushStyle, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}