contentLength property

  1. @override
int get contentLength
override

Returns the content length of the response body. Returns -1 if the size of the response body is not known in advance.

If the content length needs to be set, it must be set before the body is written to. Setting the content length after writing to the body will throw a StateError.

Implementation

@override
int get contentLength =>
    // ignore: invalid_use_of_visible_for_testing_member
    super.noSuchMethod(Invocation.getter(#contentLength), returnValue: 0)
        as int;