zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 622 forks source link

Dependency Issue with latest flutter SDK and Connectivity Plus #1432

Closed gaurav-webbytroops closed 5 months ago

gaurav-webbytroops commented 6 months ago

I tried to install the package but it is throwing error with recent flutter SDK version and Connectivity_plus package.

I get Following error in console: `The current Dart SDK version is 3.4.1.

Because graphql >=5.2.0-beta.2 <5.2.0-beta.3 requires SDK version >=2.15.0 <=3.0.0 and graphql >=5.2.0-beta.3 depends on
  gql_exec ^1.0.0, graphql >=5.2.0-beta.2 requires gql_exec ^1.0.0.
And because graphql_flutter >=5.0.0-nullsafety.5 <5.0.1-beta.2 depends on gql_exec ^0.3.0 and graphql_flutter
  >=5.0.0-nullsafety.5 <5.0.0 depends on graphql ^5.0.0-nullsafety.5, graphql_flutter >=5.0.0-nullsafety.5 <5.0.0 requires
  graphql >=5.0.0-nullsafety.5 <5.2.0-beta.2.
And because graphql_flutter >=5.1.1-beta.5 <5.2.0-beta.2 depends on connectivity_plus ^3.0.0 and graphql_flutter
  >=5.0.1-beta.1 <5.1.1-beta.5 depends on connectivity_plus ^2.0.3, graphql_flutter >=5.0.0-nullsafety.5 <5.0.0 or
  >=5.0.1-beta.1 <5.2.0-beta.2 requires graphql >=5.0.0-nullsafety.5 <5.2.0-beta.2 or connectivity_plus ^2.0.3 or ^3.0.0.
And because graphql_flutter >=5.0.0 <5.0.1-beta.1 depends on connectivity_plus ^1.0.1 and graphql_flutter >=0.8.0
  <5.0.0-beta.1 doesn't support null safety, graphql_flutter >=0.8.0 <5.0.0-beta.1 or >=5.0.0-nullsafety.5 <5.2.0-beta.2
  requires graphql >=5.0.0-nullsafety.5 <5.2.0-beta.2 or connectivity_plus ^1.0.1 or ^2.0.3 or ^3.0.0.
And because graphql_flutter >=0.4.0 <0.8.0 depends on http ^0.11.0 and graphql_flutter <0.4.0 doesn't support null safety,
  graphql_flutter <5.0.0-beta.1 or >=5.0.0-nullsafety.5 <5.2.0-beta.2 requires graphql >=5.0.0-nullsafety.5 <5.2.0-beta.2 or
  connectivity_plus ^1.0.1 or ^2.0.3 or ^3.0.0 or http ^0.11.0.
And because graphql_flutter >=5.2.0-beta.6 depends on connectivity_plus ^5.0.0 and graphql_flutter >=5.2.0-beta.4
  <5.2.0-beta.6 depends on connectivity_plus ^4.0.0, graphql_flutter <5.0.0-beta.1 or >=5.0.0-nullsafety.5 <5.2.0-beta.2 or
  >=5.2.0-beta.4 requires graphql >=5.0.0-nullsafety.5 <5.2.0-beta.2 or connectivity_plus ^1.0.1 or ^2.0.3 or ^3.0.0 or ^4.0.0
  or ^5.0.0 or http ^0.11.0.

(1) So, because graphql_flutter >=5.2.0-beta.3 <5.2.0-beta.4 depends on connectivity_plus ^3.0.0 and graphql_flutter

=5.2.0-beta.2 <5.2.0-beta.3 requires SDK version >=2.12.0 <=3.0.0, graphql_flutter <5.0.0-beta.1 or >=5.0.0-nullsafety.5 requires graphql >=5.0.0-nullsafety.5 <5.2.0-beta.2 or connectivity_plus ^1.0.1 or ^2.0.3 or >=3.0.0 <4.0.0 or ^4.0.0 or ^5.0.0 or http ^0.11.0.

Because graphql >=5.2.0-beta.2 <5.2.0-beta.3 requires SDK version >=2.15.0 <=3.0.0 and graphql >=5.2.0-beta.3 depends on
  gql_exec ^1.0.0, graphql >=5.2.0-beta.2 requires gql_exec ^1.0.0.
And because graphql_flutter >=5.0.0-beta.1 <5.0.0-nullsafety.1 depends on gql_exec ^0.3.0, graphql >=5.2.0-beta.2 is
  incompatible with graphql_flutter >=5.0.0-beta.1 <5.0.0-nullsafety.1.
Because graphql_flutter >=5.0.0-beta.1 <5.0.0-beta.2 depends on graphql ^5.0.0-beta.1 and graphql_flutter >=5.0.0-beta.2
  <5.0.0-nullsafety.1 depends on graphql ^5.0.0-beta.2, graphql_flutter >=5.0.0-beta.1 <5.0.0-nullsafety.1 requires graphql
  ^5.0.0-beta.1.
Thus, graphql_flutter >=5.0.0-beta.1 <5.0.0-nullsafety.1 requires graphql >=5.0.0-beta.1 <5.2.0-beta.2.

(2) So, because graphql_flutter >=5.0.0-nullsafety.1 <5.0.0-nullsafety.2 depends on graphql 5.0.0-nullsafety.1, graphql_flutter >=5.0.0-beta.1 <5.0.0-nullsafety.2 requires graphql >=5.0.0-beta.1 <5.2.0-beta.2.

Because graphql >=5.2.0-beta.2 <5.2.0-beta.3 requires SDK version >=2.15.0 <=3.0.0 and graphql >=5.2.0-beta.3 depends on
  gql_exec ^1.0.0, graphql >=5.2.0-beta.2 requires gql_exec ^1.0.0.
And because graphql_flutter >=5.0.0-nullsafety.1 <5.0.0-nullsafety.5 depends on gql_exec ^0.3.0-nullsafety.1 and
  graphql_flutter >=5.0.0-nullsafety.2 <5.0.0-nullsafety.5 depends on graphql ^5.0.0-nullsafety.3, graphql_flutter
  >=5.0.0-nullsafety.2 <5.0.0-nullsafety.5 requires graphql >=5.0.0-nullsafety.3 <5.2.0-beta.2.
And because graphql_flutter >=5.0.0-beta.1 <5.0.0-nullsafety.2 requires graphql >=5.0.0-beta.1 <5.2.0-beta.2 (2),
  graphql_flutter >=5.0.0-beta.1 <5.0.0-nullsafety.5 requires graphql >=5.0.0-beta.1 <5.2.0-beta.2.
And because graphql_flutter <5.0.0-beta.1 or >=5.0.0-nullsafety.5 requires graphql >=5.0.0-nullsafety.5 <5.2.0-beta.2 or
  connectivity_plus ^1.0.1 or ^2.0.3 or >=3.0.0 <4.0.0 or ^4.0.0 or ^5.0.0 or http ^0.11.0 (1), every version of graphql_flutter
  requires graphql >=5.0.0-beta.1 <5.2.0-beta.2 or connectivity_plus ^1.0.1 or ^2.0.3 or >=3.0.0 <4.0.0 or ^4.0.0 or ^5.0.0 or
  http ^0.11.0.
And because graphql >=5.0.0-beta.1 <5.2.0-beta.2 depends on http ^0.13.0 and neskart depends on http ^1.2.1, every version
  of graphql_flutter requires connectivity_plus ^1.0.1 or ^2.0.3 or >=3.0.0 <4.0.0 or ^4.0.0 or ^5.0.0.
So, because neskart depends on both connectivity_plus ^6.0.3 and graphql_flutter any, version solving failed.

The lower bound of "sdk: '>=1.19.0 <2.0.0'" must be 2.12.0 or higher to enable null safety. For details, see https://dart.dev/null-safety

The lower bound of "sdk: '>=2.0.0-dev.52.0 <3.0.0'" must be 2.12.0 or higher to enable null safety. For details, see https://dart.dev/null-safety

You can try the following suggestion to make the pubspec resolve:

vincenzopalazzo commented 6 months ago

we may release a new version to fix this problem?

I think this patch https://github.com/zino-hofmann/graphql-flutter/pull/1428 fix your problem

gaurav-webbytroops commented 6 months ago

@vincenzopalazzo How can we install the graphql_flutter package to our project? The stable version is not being installed because of an error and with this commit how to install the package?

vincenzopalazzo commented 6 months ago

Idk I should google it. But I can make a new beta release also for fixing your problem

ThomasAunvik commented 5 months ago

@gaurav-webbytroops Just like so:

graphql_flutter:
    git:
      url: https://github.com/zino-hofmann/graphql-flutter.git
      ref: c0621ccad047d3ec94565f92406ebeda394dbd4c
      path: packages/graphql_flutter
johnmartel commented 5 months ago

But I can make a new beta release also for fixing your problem

@vincenzopalazzo That would be awesome!

Although we can depend on the commit from #1428 , it's easier for folks who rely on Renovate/Dependabot for upgrades to stay on official releases, even if it's a beta.

vincenzopalazzo commented 5 months ago

@johnmartel it is coming!