on_connectivity_widget 1.0.0 on_connectivity_widget: ^1.0.0 copied to clipboard
Flutter Package used to listen network connection and show a custom message to application.
on_connectivity_widget #
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.
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.0.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
[Features]
How to use: #
OnConnectivityWidget() // The main widget to start using the plugin.
All types of parameters on this plugin:
Parameters | Arguments | Description |
---|---|---|
position |
PositionType? |
Used to define message position |
wifiWidget |
Widget? |
Widget shown when network state is: Wifi. |
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. |
animationType |
Curve? |
Used to define what animation type will be shown. |
cancelInitState |
bool? |
Used to define if message will shown when application starts. |
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: 2),
messageDuration: Duration(seconds: 1),
position: PositionType.BOTTOM,
animationType: Curves.bounceInOut,
cancelInitState: true,
wifiWidget: Container(
color: Colors.green,
child: Text("Wifi"),
),
mobileWidget: Container(
color: Colors.blue,
child: Text("Mobile"),
),
noneWidget: Container(
color: Colors.red,
child: Text("None"),
),
//customAnimation: null,
//customPosition: null,
);