signalr_client
signalr_client copied to clipboard
Handle Lists from backend
Hi, how can I handle lists from the backend. I have a List of string and I want to parse to dart objects.
The backend consists of returning a list of strings
private static readonly Dictionary<string, string> userLookup = new();
await Clients.All.SendAsync(
Messages.USER.JOINED,
JsonConvert.SerializeObject(userLookup.Select(x => x.Value)));
The frontend
hubHelper.hubConnection.on('USER_JOINED', (args) {
var response = args![0]! as List<String>;
print(response);
});
I can do the trim, but it's not supposed to deserialize the object into a List<String> in dart?