on_connectivity_widget 1.1.0 copy "on_connectivity_widget: ^1.1.0" to clipboard
on_connectivity_widget: ^1.1.0 copied to clipboard

Flutter Package used to listen network connection and show a custom message to application.

on_connectivity_widget #

Pub.dev Platforms Flutter

on_connectivity_widget is a Flutter Package used to listen network states and show a custom message to application.

This Plugin uses connectivity_plus as dependency to listen network states and on_toast_widget to show custom and animated messages.

Help: #

Any problem? Issues
Any suggestion? Pull request

Translations: #

NOTE: Feel free to help with readme translations

Topics: #

How to Install: #

Add the following code to your pubspec.yaml:

dependencies:
  on_connectivity_widget: ^1.1.0

Some Features: #

  • Everytime network state change, will shown a message.
  • All message has a default widget, but, you can create your own.
  • You can define Animation type.
  • You can create/set your own Animation.
  • You can define how long Animation will last.
  • You can define Position type.
  • You can create/set your own Position.
  • You can define how long Position will last.

TODO: #

  • Fix bugs.
  • Add more default animations.
  • Add more [Features]

How to use: #

OnConnectivityWidget() // The main widget to start using the plugin.

All types of parameters on this plugin:

Parameters Arguments Description
position SlidePositionType? Used to define message position
bluetoothWidget Widget? Widget shown when connection state is: Bluetooth.
wifiWidget Widget? Widget shown when network state is: Wifi.
ethernetWidget Widget? Widget shown when network state is: Ethernet.
mobileWidget Widget? Widget shown when network state is: Mobile
noneWidget Widget? Widget shown when network state is: Offline.
animationDuration Duration? Used to define how long animation will last.
messageDuration Duration? Used to define how long message will last.
messageDurationWhenOnline Duration? Used to define how long message will after [showNoneUntilOnline].
animationType Curve? Used to define what animation type will be shown.
cancelInitState bool? Used to define if message will shown when application starts.
showNoneUntilOnline bool? Used to define if message will await until network connect.
customAnimation Animation<Offset>? Used if you want use your own animation.
customPosition Alignment? Used if you want use your own position.

See more in Documentation

Example: #

OnConnectivityWidget

  OnConnectivityWidget(
    animationDuration: Duration(seconds: 1),
    messageDuration: Duration(seconds: 2),
    position: SlidePositionType.BOTTOM,
    showNoneUntilOnline: true,
    messageDurationWhenOnline: Duration(seconds: 2),
    animationType: Curves.bounceInOut,
    cancelInitState: false,
    bluetoothWidget: OnMessageWidget(
      title: 'You\'re online',
      desc: 'Your current connection is: Bluetooth',
      color: Colors.lightBlue[200]!,
      icon: Icons.check_circle_outline_rounded,
    ),
    wifiWidget: const OnMessageWidget(
      title: 'You\'re online',
      desc: 'Your current connection is: Wifi',
      color: Colors.green,
      icon: Icons.check_circle_outline_rounded,
    ),
    ethernetWidget: OnMessageWidget(
      title: 'You\'re online',
      desc: 'Your current connection is: Ethernet',
      color: Colors.lightGreen[200]!,
      icon: Icons.check_circle_outline_rounded,
    ),
    mobileWidget: const OnMessageWidget(
      title: 'You\'re online',
      desc: 'Your current connection is: Mobile',
      color: Colors.blue,
      icon: Icons.check_circle_outline_rounded,
    ),
    noneWidget: const OnMessageWidget(
      title: 'You\'re offline',
      desc: 'Your current connection is: Offline',
      color: Colors.red,
      icon: Icons.error_outline_rounded,
    ),
    //customAnimation: null,
    //customPosition: null,
  ),;

LICENSE: #

9
likes
120
pub points
32%
popularity

Publisher

verified publisherlucasjosino.com

Flutter Package used to listen network connection and show a custom message to application.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

connectivity_plus, flutter, on_toast_widget

More

Packages that depend on on_connectivity_widget