How to set timeout for HTTPClient get() request in Flutter?

Posted by Andre Scott | Updated on

Want to set timeout for HTTPClient get() request in Flutter? You can set a timeout on any Future using the Future.timeout method. This will short-circuit after the given duration has elapsed by throwing a TimeoutException.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers