headSent method

  1. @override
bool headSent(
  1. HttpResponse res
)
override

dart:io does not tell, but its statusCode setter throws a StateError once the head is out. Only the error path asks.

Implementation

@override
bool headSent(HttpResponse res) {
  try {
    res.statusCode = res.statusCode;
    return false;
  } on StateError {
    return true;
  }
}