Access to dart files or better documentation of object types

Custom Code

Hi,

I am writing an interceptor and I can't find detailed documentation of the objects that are passed into OnRequest and OnResponse and for some reason autocorrection isn't working, even though from my experience it doesn't go into the actual method information.

So first of all, can we get access to "/backend/api_requests/api_interceptor.dart" so we can see all the methods we can do on these objects?

If we can't get access to the files, is the actual detailed documentation about what the methods and properties of the ApiCallOptions and ApiCallResponse objects ?

I tried to do something simple like rewriting the options.body with simple setter and it fails to compile, from what I read in the API 101, it seems like the interceptors were made for this very purpose and other purposes but without any documentation or access to the code I really don't know what I can or can't do with those objects.

The same goes with the response body, I tried to get the actual content via response.body and it fails to compile.

It's really time consuming trying to guess how to manipulate these objects and the example interceptors really don't do much or are not exhaustive enough to be able to do these types of manipulations

What have you tried so far?

in the onRequest, for re-writing the options.body I tried to set it via

options.body = 'new body text' 

And an error is returned saying that the setter doesn't exist

in the onResponse, I am trying to access the response content via

print(response.body)

I get an error saying "The getter 'body' isn't defined for the type 'ApiCallResponse'. Try importing the library that defines 'body', correcting the name to the name of an existing "

Where can I get access to the type definitions?

Did you check FlutterFlow's Documentation for this topic?
Yes
1
3 replies