AS-Devs / signalr_flutter

A flutter plugin for .net SignalR client.
https://pub.dev/packages/signalr_flutter
MIT License
19 stars 27 forks source link

What is the proper way to send objects as arguments #49

Open st-gwerner opened 1 year ago

st-gwerner commented 1 year ago

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.