'Is there a way to check the strength of internet connection in flutter?
I am trying to upload some multimedia files(Images, Audio and Videos) to my server and I only want to upload these files if there is a stable internet connection. Is there a concrete way to achieve this?
Solution 1:[1]
One year after, there is a new (Mar. 31, 2020) package that solves this need. Check at https://pub.dev/packages/internet_speed_test#-readme-tab-
Solution 2:[2]
there no way to check that currently . but You can try to upload or download a file and calculate the time it took
Solution 3:[3]
You can use dart's connectivity_plus package which is maintained by Google team, according to its documentation :
"This plugin allows Flutter apps to discover network connectivity and configure themselves accordingly. It can distinguish between cellular vs WiFi connection. This plugin works for iOS and Android."
This way you can use the plugin to determine whether the user is connected over Wifi and if so upload the data, otherwise not to upload and wait for connection type change.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | abnerh69 |
Solution 2 | Mohamed hassan kadri |
Solution 3 | Abdul Rehman |