Reputation: 11
I have been studying over dart projects and tesing dart packages and interdependencies. I created a Dart Project called console_full_project, where within the project i made a package called calculator and added it to main projects pubspec.yaml file.
main project's pubspec.yaml codes are
name: console_full_project
description: A sample command-line application.
version: 1.0.0
publish_to: none
# homepage: https://www.example.com
environment:
sdk: ">=2.17.0-266.8.beta <3.0.0"
dependencies:
calculator:
path: "packages/calculator"
dev_dependencies:
lints: ^2.0.0
test: ^1.16.0
and my packages pubspec.yaml file's codes are
name: calculator
environment:
sdk: ">=2.10.0<3.0.0"
dependencies:
lints: ^2.0.0
While a tried dart run
command in my terminal
It resulted
Failed to build console_full_project:console_full_project: Error: Cannot run with sound null safety, because the following dependencies don't support null safety:
For solutions, see https://dart.dev/go/unsound-null-safety
Upvotes: 0
Views: 112
Reputation: 1428
There are many solutions to this problem.
environment
variable in pubspec.yaml
file to 2.10.0
environment:
sdk: ">=2.10.0 <3.0.0"
flutter run --no-sound-null-safety
Note: The following options might not be available if the package is out of your control.
environment
variable in pubspec.yaml
file to 2.12.0
or aboveenvironment:
sdk: ">=2.12.0 <3.0.0"
dart migrate
commandUpvotes: 1