OnConnectivityWidget class

Main Widget for use on_connectivity_widget

This Widget will listen and show a custom message everytime network state change.

Example:

OnConnectivityWidget(
  animationDuration: Duration(seconds: 2),
  messageDuration: Duration(seconds: 1),
  position: SlidePositionType.BOTTOM,
  animationType: Curves.bounceInOut,
  cancelInitState: true,
  bluetoothWidget: Container(
    color: Colors.lightGreen,
    child: Text("Bluetooth"),
  ),
  wifiWidget: Container(
    color: Colors.green,
    child: Text("Wifi"),
  ),
  ethernetWidget: Container(
    color: Colors.lightBlue,
    child: Text("Ethernet"),
  ),
  mobileWidget: Container(
    color: Colors.blue,
    child: Text("Mobile"),
  ),
  noneWidget: Container(
    color: Colors.red,
    child: Text("None"),
  ),
  //customAnimation: null,
  //customPosition: null,
);

Important:

Inheritance

Constructors

OnConnectivityWidget({Key? key, Widget? bluetoothWidget, Widget? mobileWidget, Widget? ethernetWidget, Widget? noneWidget, Widget? wifiWidget, SlidePositionType? position, bool? cancelInitState, Animation<Offset>? customAnimation, Alignment? customPosition, Duration? messageDuration, Duration? messageDurationWhenOnline, Duration? animationDuration, Curve? animationType, bool? showNoneUntilOnline = true})
Main Widget for use on_connectivity_widget
const

Properties

animationDuration Duration?
animationDuration is used to define how long animation will last.
final
animationType Curve?
animationType is used to define what animation type will be shown.
final
bluetoothWidget Widget?
bluetoothWidget the Widget shown when network state is: Bluetooth.
final
cancelInitState bool?
cancelInitState is used to define if message will shown when application starts.
final
customAnimation Animation<Offset>?
customAnimation if you want use your own animation.
final
customPosition Alignment?
customPosition if you want use your own position.
final
ethernetWidget Widget?
EthernetWidget the Widget shown when network state is: Ethernet.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
messageDuration Duration?
messageDuration is used to define how long message will last.
final
messageDurationWhenOnline Duration?
messageDurationWhenOnline is used to define how long message will after showNoneUntilOnline.
final
mobileWidget Widget?
mobileWidget the Widget shown when network state is: Mobile.
final
noneWidget Widget?
noneWidget the Widget shown when network state is: Offline.
final
position SlidePositionType?
position is used to define message position.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showNoneUntilOnline bool?
showNoneUntilOnline is used to define if message will await until network connect.
final
wifiWidget Widget?
wifiWidget the Widget shown when network state is: Wifi.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _OnConnectivityWidgetState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited