Connectivity constructor

Connectivity()

Constructs a singleton instance of Connectivity.

Connectivity is designed to work as a singleton.

Implementation

// When a second instance is created, the first instance will not be able to listen to the
// EventChannel because it is overridden. Forcing the class to be a singleton class can prevent
// misusage of creating a second instance from a programmer.
factory Connectivity() {
  if (_singleton == null) {
    _singleton = Connectivity._();
  }
  return _singleton;
}