connectivity_alert_widget 2.0.0+2 copy "connectivity_alert_widget: ^2.0.0+2" to clipboard
connectivity_alert_widget: ^2.0.0+2 copied to clipboard

A Flutter package to handle connectivity in an elegant way, giving power to the user to display different widgets when there's or there isn't connectivity

Buy Me A Coffee

A package to simplify the task of showing users whether they are online or offline

Using #

The package has the ConnectivityAlertWidget, to use it only pass the widget to show when online and the widget to show when offline. The package abstract all of the hard work.

ConnectivityAlertWidget(
  onlineWidget: Icon(Icons.network_wifi, color: Colors.green, size: 280),
  offlineWidget: Icon(Icons.signal_wifi_off, color: Colors.red, size: 280),
  onConnectivityResult: (connectivity) => print(connectivity),
)

You can choose anything to be your onlineWidget or offlineWidget but it's recomended to use something that easily inform the user about her current online status.

Example

If you want to do anything when there's connectivity changes, you can implement onConnectivityResult, as it gives you a callback to be executed on every connectivity change.

14
likes
160
pub points
50%
popularity

Publisher

verified publisherrodrigobastos.dev

A Flutter package to handle connectivity in an elegant way, giving power to the user to display different widgets when there's or there isn't connectivity

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

connectivity, flutter

More

Packages that depend on connectivity_alert_widget