Hey, currently I dont seem to be able to find a way to give req and res in Future<void> start(final req, final res) a type which is pretty annoying. Are there any types for req and res I can use?`Something like AppwriteRequest or AppwriteResponse
Summary
There is currently no built-in type support for req and res in Dart cloud functions. However, you can use a workaround by defining your own AppwriteRequest and AppwriteResponse classes. Here is an example implementation:
```dart
class AppwriteRequest {
final Map<String, dynamic> variables;
final Map<String, dynamic> headers;
final String payload;
AppwriteRequest({
this.variables = const {},
this.headers = const {},
this.payload = '',
});
}
class AppwriteResponse {
int _status = 200;
dynamic _text;
int get status => _status;
dynamic get
Drake
Admin
Mar 28, 2023, 19:34
We've had discussions about exposing the types. For now, maybe you can copy and paste this and cast the variables in your function body.