Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Lists from backend #57

Open
hashproton opened this issue Aug 3, 2023 · 0 comments
Open

Handle Lists from backend #57

hashproton opened this issue Aug 3, 2023 · 0 comments

Comments

@hashproton
Copy link

hashproton commented Aug 3, 2023

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);
  });
image

I can do the trim, but it's not supposed to deserialize the object into a List in dart?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant