I am encountering an issue where, despite attempting multiple solutions like updating, cleaning, and deleting pubspec.lock
file, I still receive an error when running flutter pub get
from the terminal. The error output displays Dart SDK version 3.0.1, however running pub get
from my pubspec.yaml
file causes the following error:
The current Dart SDK version is 2.18.2.
Because book_my_guide depends on http >=0.13.6 which requires SDK version >=2.19.0 <3.0.0 or ^3.0.0, version solving failed.
pub get failed (1; Because book_my_guide depends on http >=0.13.6 which requires SDK version >=2.19.0 <3.0.0 or ^3.0.0, version solving failed.)
Process finished with exit code 1
2
Answers
The book_my_guide plugin you used is expecting dart SDK version >=2.19.0 <3.0.0. you should upgrade your dart version to use the plugin.
current stable dart version – v3.0.0
your dart version – v2.18.2
just run flutter upgrade command to move to stable.
change this in your pubspac.yaml file
environment:
sdk: ">=3.0.0 <4.0.0"