Hey there, I am getting the following exception while trying to stop the connection occasionally:
FlutterError - Bad state: Future already completed
To fix the error, you may add in a check before closing the connection in line 280 of 'src/http_connection.dart':
From:
if (_connectionState == ConnectionState.disconnecting) {
// A call to stop() induced this call to stopConnection and needs to be completed.
// Any stop() awaiters will be scheduled to continue after the onclose callback fires.
_stopCompleter.complete();
}
To:
if (_connectionState == ConnectionState.disconnecting) {
if (!_stopCompleter.isCompleted) {
// A call to stop() induced this call to stopConnection and needs to be completed.
// Any stop() awaiters will be scheduled to continue after the onclose callback fires.
_stopCompleter.complete();
}
}
Hey there, I am getting the following exception while trying to stop the connection occasionally: FlutterError - Bad state: Future already completed
To fix the error, you may add in a check before closing the connection in line 280 of 'src/http_connection.dart': From:
To:
Thank you