Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/src/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PhoenixChannel {
PhoenixChannel.fromSocket(
this.socket, {
required this.topic,
Map<String, dynamic>? parameters,
dynamic parameters,
Duration? timeout,
}) : _controller = StreamController.broadcast(),
_waiters = {},
Expand All @@ -57,7 +57,7 @@ class PhoenixChannel {
}

/// Parameters passed to the backend at join time.
final Map<String, dynamic> parameters;
final dynamic parameters;

/// The [PhoenixSocket] through which this channel is established.
final PhoenixSocket socket;
Expand Down Expand Up @@ -247,7 +247,7 @@ class PhoenixChannel {
/// The message payload.
///
/// This needs to be a JSON encodable object.
Map<String, dynamic> payload, [
dynamic payload, [
/// Manually set timeout value for this push.
///
/// If not provided, the default timeout will be used.
Expand All @@ -265,7 +265,7 @@ class PhoenixChannel {
/// using [push] instead.
Push pushEvent(
PhoenixChannelEvent event,
Map<String, dynamic> payload, [
dynamic payload, [
Duration? newTimeout,
]) {
assert(_joinedOnce);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/push.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class PushResponse {
}

/// Type of function that should return a push payload
typedef PayloadGetter = Map<String, dynamic> Function();
typedef PayloadGetter = dynamic Function();

/// Object produced by [PhoenixChannel.push] to encapsulate
/// the message sent and its lifecycle.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class PhoenixSocket {
return (_pendingMessages[message.ref!] = Completer<Message>()).future;
}

void _addToSink(String data) {
void _addToSink(dynamic data) {
if (_disposed) {
return;
}
Expand All @@ -360,7 +360,7 @@ class PhoenixSocket {
/// [parameters] are any options parameters you wish to send
PhoenixChannel addChannel({
required String topic,
Map<String, dynamic>? parameters,
dynamic parameters,
Duration? timeout,
}) {
PhoenixChannel? channel = channels[topic];
Expand Down
35 changes: 14 additions & 21 deletions test/mocks.mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,6 @@ class _FakeMessageSerializer_8 extends _i1.SmartFake
///
/// See the documentation for Mockito's code generation for more information.
class MockPhoenixChannel extends _i1.Mock implements _i5.PhoenixChannel {
@override
Map<String, dynamic> get parameters => (super.noSuchMethod(
Invocation.getter(#parameters),
returnValue: <String, dynamic>{},
returnValueForMissingStub: <String, dynamic>{},
) as Map<String, dynamic>);

@override
_i2.PhoenixSocket get socket => (super.noSuchMethod(
Invocation.getter(#socket),
Expand Down Expand Up @@ -330,7 +323,7 @@ class MockPhoenixChannel extends _i1.Mock implements _i5.PhoenixChannel {
@override
_i4.Push push(
String? eventName,
Map<String, dynamic>? payload, [
dynamic payload, [
Duration? newTimeout,
]) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -369,7 +362,7 @@ class MockPhoenixChannel extends _i1.Mock implements _i5.PhoenixChannel {
@override
_i4.Push pushEvent(
_i11.PhoenixChannelEvent? event,
Map<String, dynamic>? payload, [
dynamic payload, [
Duration? newTimeout,
]) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -531,14 +524,14 @@ class MockPhoenixSocket extends _i1.Mock implements _i2.PhoenixSocket {
) as _i10.Stream<_i3.Message>);

@override
_i10.Future<_i2.PhoenixSocket?> connect() => (super.noSuchMethod(
_i10.Future<void> connect() => (super.noSuchMethod(
Invocation.method(
#connect,
[],
),
returnValue: _i10.Future<_i2.PhoenixSocket?>.value(),
returnValueForMissingStub: _i10.Future<_i2.PhoenixSocket?>.value(),
) as _i10.Future<_i2.PhoenixSocket?>);
returnValue: _i10.Future<void>.value(),
returnValueForMissingStub: _i10.Future<void>.value(),
) as _i10.Future<void>);

@override
void close([
Expand Down Expand Up @@ -618,7 +611,7 @@ class MockPhoenixSocket extends _i1.Mock implements _i2.PhoenixSocket {
@override
_i5.PhoenixChannel addChannel({
required String? topic,
Map<String, dynamic>? parameters,
dynamic parameters,
Duration? timeout,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -678,13 +671,6 @@ class MockWebSocketChannel extends _i1.Mock implements _i6.WebSocketChannel {
returnValueForMissingStub: _i10.Future<void>.value(),
) as _i10.Future<void>);

@override
_i10.Stream<dynamic> get stream => (super.noSuchMethod(
Invocation.getter(#stream),
returnValue: _i10.Stream<dynamic>.empty(),
returnValueForMissingStub: _i10.Stream<dynamic>.empty(),
) as _i10.Stream<dynamic>);

@override
_i6.WebSocketSink get sink => (super.noSuchMethod(
Invocation.getter(#sink),
Expand All @@ -698,6 +684,13 @@ class MockWebSocketChannel extends _i1.Mock implements _i6.WebSocketChannel {
),
) as _i6.WebSocketSink);

@override
_i10.Stream<dynamic> get stream => (super.noSuchMethod(
Invocation.getter(#stream),
returnValue: _i10.Stream<dynamic>.empty(),
returnValueForMissingStub: _i10.Stream<dynamic>.empty(),
) as _i10.Stream<dynamic>);

@override
void pipe(_i7.StreamChannel<dynamic>? other) => super.noSuchMethod(
Invocation.method(
Expand Down
Loading