I have seen library importations without version numbers being used in the pubspec.yaml such as
dependencies:
flutter:
sdk: flutter
webview_flutter:
device_info:
what does this mean in flutter and how does flutter treat it?
I have seen library importations without version numbers being used in the pubspec.yaml such as
dependencies:
flutter:
sdk: flutter
webview_flutter:
device_info:
what does this mean in flutter and how does flutter treat it?
In a simple way, It means you are not imposing any constraints on the version of the package you want to choose, and in a way, you are allowing dart to be responsible for what version it would use. Generally it is similar to using the word any and it gets the latest version or latest allowed version to be specific to get from pub.
This way is not preferred as per: https://dart.dev/tools/pub/dependencies and not suitable generally for large projects where versioning is important to know conflicts the better way. Using other ways specified in the above link you enforce tighter constraints and limit flutter to look for versions you specify.
Now what this leads is the internal dependencies the packages use are according to the constraints they put.If 2 packages with same dependencies, Now if one of the packages is not updated and other is, using blank would mean the internal dependency would be according to the old one. (Note this is just a case and may have other implications too)