I am implementing an app that I should handle offline mode. When I check the internet connection and it is not connected, I should add the API
request to a queue to be executed when the internet connection is back again.
How can I do that?
I tried to add class names and the method names to the queue, but couldn't call the method from a class dynamically.
I am using Dio package to handle API
requests.
if you remove
await
from your requests you can save them asFuture<dynamic>
for Examplenow You can save it in
List<Future<dynamic>> myList = List()
and when you want to call itOr