Back

[SOLVED] Improper invoking of Functions from Flutter

  • 0
  • Functions
Aarush Acharya
9 Jul, 2023, 12:46

Hey all, I have been trying to make a function invocation from dart code but the execution always keeps failing but if I i with similar initial data test the function out from console it works, please do let me know where do I go wrong

I have uploaded the screenshots of my dart code where I am trying to invoke the function along with my Nodejs function code and the error I am getting please do let me know where I am wrong

TL;DR
The user was having trouble invoking a function from Flutter. They were advised to convert the function output into a JSON format and then into a string before sending it. They were also reminded to use jsonencode and ensure that they are sending a JSON instead of a string. The user uploaded screenshots of their code and asked for assistance in identifying where they went wrong. The problem was solved by converting the function output into JSON and then into a string.
Aarush Acharya
9 Jul, 2023, 12:46

this is console initial input on which it executes successfully

D5
9 Jul, 2023, 12:50

You're sending string instead of JSON

D5
9 Jul, 2023, 12:51

So you will need using jsonencode

D5
9 Jul, 2023, 12:51

Or decode in the function

Aarush Acharya
9 Jul, 2023, 13:06
Aarush Acharya
9 Jul, 2023, 13:37

@D5 What if I first convert it into json

Aarush Acharya
9 Jul, 2023, 13:37

then convert it into string then send

Aarush Acharya
9 Jul, 2023, 13:37

would that work ?

Aarush Acharya
9 Jul, 2023, 13:48

Okay it worked

Aarush Acharya
9 Jul, 2023, 13:48

Thanks a lot

Aarush Acharya
9 Jul, 2023, 13:48

turning it into json then to string worked

Aarush Acharya
9 Jul, 2023, 13:49

[SOLVED] Improper invoking of Functions from Flutter

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more