Vanethos / flutter_connectivity_widget

A widget that shows the user if the phone is connected to the internet or not
BSD 2-Clause "Simplified" License
68 stars 34 forks source link

offlineCallback does not appear to be firing #17

Open brookesia opened 4 years ago

brookesia commented 4 years ago

Hi,

This looks like a great widget, I'm just trying it out at the moment to see if it will work for my app.

It seems to be working well when going from offline to online, however, going from online to offline doesn't appear to work, in the code snippet below offlineCallback is never called, additionally the offlineBanner doesn't show when going from online to offline.

The offlineBanner does show if the app starts up when offline, it's just the change from online to offline that doesn't appear to be working

...
body: ConnectivityWidget(
        onlineCallback: () {
          print('online');
        },
        offlineCallback: () {
          print('offline');
        },
        builder: (context, isOnline) {
          return CustomPaint(
...

Any suggestions grealty received.

MaheshPeri19 commented 4 years ago

Good one. But the issue. It is working for same device wifi / mobile connection on and off. Below is not working case.

Tested scenario :

connected internet via mobile hotspot with other mobile. when connected, online is showing. When i off the internet in other device, wifi is not connected, but showing online.