0

I was trying out includeObject method with my livequery in one of my project. I am using Parse_Server_Sdk for this back4App database. Also, I am using flutter parse_server_sdk latest version 1.0.26.

What i want is i have a list of events. So whenever a new event is added in my database then it should trigger the subscription method. I have used following code and it works as well. But, only thing i have issue with is i don't get the includedobject i have added in QueryBuilder.

QueryBuilder<ParseObject> parseQuery =
        QueryBuilder<ParseObject>(ParseObject(tblEvents))
          ..whereEqualTo(tblEventUserId, currentUser);
    parseQuery.includeObject([tblOrganizerId]);

    Subscription subscription = await liveQuery.client.subscribe(parseQuery);
    subscription.on(LiveQueryEvent.create, (value) {
      print("val : ${value}");
      print("val : ${value.runtimeType}");
    });

Output :

val : {"className":"Group_Events","objectId":"uotQ6BpT4C","createdAt":"2020-08-27T07:18:26.581Z","updatedAt":"2020-08-27T07:18:26.581Z","organizer_id":{"__type":"Pointer","className":"Organizer","objectId":"t9M1oyZHh4"},"user_id":{"__type":"Pointer","className":"_User","objectId":"Hx5xJ5ABxG"},"weight":1}
I/flutter (30335): val : ParseObject

I have also evaluated the expression. But, there is only limited pointer data to "tblOrganizerId". I am not getting whole data of that table.

Can anyone suggest me a workaround or a solution?

Thanks.

1 Answer 1

1

I would use the "ParseLiveListWidget". It should be perfect for this scenario. You can find an example here. Additional information is in this README. (Use version 1.0.27 for some important bug fixes.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.