jossef / requests

MIT License
139 stars 53 forks source link

Cannot use requests in Flutter 3.3.0 project. #100

Open djkemmet opened 5 months ago

djkemmet commented 5 months ago

Describe the bug Cannot add requests to Flutter 3.3.0 project via flutter pub add requests or 'dart pub add requests`

To Reproduce Steps to reproduce the behavior:

  1. In android studio with my code open
  2. Run "Flutter pub add requests" in the terminal, which is set to my project directory.
  3. Recieve the following error:

The current Dart SDK version is 3.3.0.

Because requests >=4.1.0 depends on http ^0.13.4 and requests <4.1.0 doesn't support null safety, every version of requests requires http ^0.13.4. So, because platform_automation_platform depends on both http ^1.2.1 and requests any, version solving failed.

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

Expected behavior The package will install on my system and become accessible for consumption in my code.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Flutter Web Project written on an M1 MacBook Pro.

derrickgw commented 4 months ago

This is fixed in v5.0. Unfortunately, that version has not yet been pushed to pub.dev. See #99 and #95

In the meantime you can use the override:

dependency_overrides:
  http: ^1.0.0