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?
Asked
Active
Viewed 94 times
0
-
Can you post your code? We need to see the structure to help you. – Plumillon Forge Feb 20 '23 at 18:39
1 Answers
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