Skip to content

Commit

Permalink
Dart formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
buijs-dev committed Mar 17, 2024
1 parent b2720aa commit 0fb08f5
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions lib/src/publisher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ Future<AdapterResponse<OUT>> doEvent<OUT>({

/// Send the event and wait for a response.
final response = await _sendEvent(
sendRequest: () => channel.invokeMethod<dynamic>(event, request),
decode: decode,
decodeBuffer: decodeBuffer
);
sendRequest: () => channel.invokeMethod<dynamic>(event, request),
decode: decode,
decodeBuffer: decodeBuffer);

/// Check if state is mounted.
///
Expand Down Expand Up @@ -140,15 +139,15 @@ Exception _failureToException(dynamic e) =>
e is Error ? Exception(e.stackTrace) : e as Exception;

dynamic _toRequestMessage(
dynamic message,
String Function(dynamic)? encode,
Uint8List Function(dynamic)? encodeBuffer,
dynamic message,
String Function(dynamic)? encode,
Uint8List Function(dynamic)? encodeBuffer,
) {
if (message == null) {
return null;
}

if(encodeBuffer != null) {
if (encodeBuffer != null) {
return encodeBuffer(message);
}

Expand All @@ -167,8 +166,7 @@ dynamic _handleResult<OUT>({
if (response == null) {
return response;
}
return decodeBuffer?.call(response as List<int>)
?? decode?.call(response.toString())
?? response;

return decodeBuffer?.call(response as List<int>) ??
decode?.call(response.toString()) ??
response;
}

0 comments on commit 0fb08f5

Please sign in to comment.