AppSettings constructor

AppSettings()

Implementation

AppSettings() {
  if (!kIsWeb) {
    connection.InternetConnectionCheckerPlus()
        .onStatusChange
        .listen((status) async {
      switch (status) {
        case connection.InternetConnectionStatus.connected:
          _status = InternetConnectionStatus.connected;
          if (_afterConnectionFunc != null) {
            _afterConnectionFunc!(InternetConnectionStatus.connected);
          }
          break;
        case connection.InternetConnectionStatus.disconnected:
          _status = InternetConnectionStatus.disconnected;
          if (_afterConnectionFunc != null) {
            _afterConnectionFunc!(InternetConnectionStatus.disconnected);
          }
          break;
      }
    });
  }
}