Serena Mendanha
Serena Mendanha

Reputation: 1

How to enable null safety in Flutter?

I tried flutter upgrade cmd but it didn't fix the problem.

When I click get dependencies, I get an error like the screenshot

and then if I try to Change pubspec.yaml

sdk: ">=2.1.0 <3.0.0

to sdk: ">=2.12.0 <3.0.0

it shows

C:\src\flutter\flutter\bin\flutter.bat --no-color pub get Resolving dependencies... The current Dart SDK version is 3.0.2. Because mi_card depends on cupertino_icons >=0.1.1 <1.0.1 which doesn't support null safety, version solving failed. The lower bound of "sdk: '<2.0.0 or >=2.0.0-dev.28.0 <3.0.0'" must be 2.12.0 or higher to enable null safety. For details, see dart.dev/null-safety Process finished with exit code 1

Can you tell me the best solution for this

Upvotes: 0

Views: 765

Answers (1)

Priyanshu Paliwal
Priyanshu Paliwal

Reputation: 2388

run flutter upgrade command in the console.

Upvotes: 0

Related Questions