0

Hi I use 'await for' for a streamedResponse. If I turn WiFi OFF, sometimes it resumes downloading after I turn it ON again, and sometimes not. What is the best way to deal deal with this? Should you wait or stop it manually when there is no Internet? If you should stop it, how to do so?

May
  • 93
  • 7

1 Answers1

0

You should stop the connection. A way how to do this you can find in this tutorial of resocoder https://resocoder.com/2019/09/23/flutter-tdd-clean-architecture-course-7-network-info/ using the package data_connection_checker

w461
  • 2,168
  • 4
  • 14
  • 40
  • I don't know how to exit await-for loop, not how to check for connection. If there is no connection, the await-for streamedresponse is not executed. – May Dec 14 '22 at 14:51