signalr_flutter icon indicating copy to clipboard operation
signalr_flutter copied to clipboard

What is the proper way to send objects as arguments

Open st-gwerner opened this issue 2 years ago • 0 comments

Our SignalR implementation has a lot of functions that accept a single class instance as input, in order to allow us to extend or deprecate properties easily. What's the proper way to send them over now that signalr_flutter has been updated to use a list of strings? A C# example of a typical client-to-server function call for us would look like this:

public void UserSetProperties(UserPropertiesPacket inputs) {
    if (inputs.NewFirstName != null) dowhatever();
    ...
}

In the past, just sending a dynamic of the class worked fine. I attempted converting the object to json, but that doesn't seem to function properly.

Thanks in advance.

st-gwerner avatar Jan 10 '23 17:01 st-gwerner