Closed Schwusch closed 4 years ago
It is a bit confusing that all constructor parameters is dynamic, when supplying the wrong type will throw a runtime error.
dynamic
AwsApiGatewayResponse({ body, isBase64Encoded, headers, statusCode, }) { this.body = body ?? ''; this.isBase64Encoded = isBase64Encoded ?? false; this.headers = headers ?? {"Content-Type": "application/json"}; this.statusCode = statusCode ?? HttpStatus.ok; }
It would make the API more friendly and less error prone if the parameters had types:
AwsApiGatewayResponse({ String body, bool isBase64Encoded, Map<String, String> headers, int statusCode, }) { this.body = body ?? ''; this.isBase64Encoded = isBase64Encoded ?? false; this.headers = headers ?? {"Content-Type": "application/json"}; this.statusCode = statusCode ?? HttpStatus.ok; }
It is a bit confusing that all constructor parameters is
dynamic
, when supplying the wrong type will throw a runtime error.It would make the API more friendly and less error prone if the parameters had types: