Skip to content

Conversation

AlaaEddineCharbib
Copy link

update connectivity_plus package to the latest version to avoid packages dependency resolving issues with other packages that depend on js 0.7.1 (e.g syncfusion_flutter_pdfviewer: ^25.1.39)

@FXschwartz
Copy link
Contributor

@bw-flagship Any chance we could get this merged soon?

@bw-flagship
Copy link
Collaborator

@FXschwartz I am fine with the upgrade, but it seems that an analyzer warning was introduced that need to be fixed before merging

@FXschwartz
Copy link
Contributor

@AlaaEddineCharbib I made the necessary change but don't have permission to push to your fork. The analyzer is complaining because Connectivity().checkConnectivity() returns a list of results and on line 69 of smart_network_asset_loader.dart we are doing just an equality check.

The change should be to make it use .contains like below.

  Future<bool> isInternetConnectionAvailable() async {
    final connectivityResult = await Connectivity().checkConnectivity();
    if (connectivityResult.contains(ConnectivityResult.none)) {
      return false;
    } else {
      try {
        final result = await InternetAddress.lookup('google.com');
        if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) {
          return true;
        }
      } on SocketException catch (_) {
        return false;
      }
    }

    return false;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants