your project might be developed using flutter older(version below 2.+). The major change in 2.x.x dart version is enabling null safety. At this moment, a lot of libs on pub.dev have been upgraded to the null safety feature.
But your old project might have some libs which are still not updated to null safety. So, your project might have mixture of both. In this case @miguel answer is partially valid (Defining sdk: ">=2.7.0 <3.0.0"
constraint). To run your project you also need to unsound the null-safety. like by running following command
flutter run --no-sound-null-safety
or add this command in configuration by go to Run->Edit Configurations. it will open the following popup and the highlighted string same as
**Recommended: **Update your project to null safety. Read more about null-safety