Closed MisterJimson closed 4 years ago
This is a bug in flutter_test
; it should not pin to exactly 1.8.0. I'll file an issue.
Note that, however we slice this, you will not be able to easily use the non-pinned pedantic with Flutter stable. However, you could work around it with a dependency_override:
name: flutter_project
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
pedantic: 1.8.0+1
dependency_overrides:
pedantic: 1.9.0
(this should generally be safe because all of the dart code in pedantic is a one line function that doesn't really change from version to version)
This also applies to flutter_driver
where it pins the pedantic version.
Should probably fix both of these at one time
@fstof flutter_driver does not depend on or pin pedantic.
I think this issue should probably be closed. Flutter very intentionally pins its dependencies, including transitive dependencies. We do this because failure to do so opens us up to strange and difficult to debug breakages when some transitive dependency makes a breaking change but doesn't properly update the semver - which happpens more often than one might expect. Flutter aims to depend on as few libraries as possible, and to pin the libraries it does depend on so that it can reliably and predictably run tests.
We do try to frequently update package dependencies - there is an open issue to automate this process at https://github.com/flutter/flutter/issues/37985
IMHO, it is a mistake for any package to ever have a direct non-dev depdnency on pedantic. The package offers only one function that is exactly this:
void unawaited(Future<void> future) {}
which is super trivial to just implement yourself and never get into conflicts between which version of pedantic two packages want to use or pin to.
And worst case scenario, you can just use a dependency override as suggested in https://github.com/dart-lang/pedantic/issues/46#issuecomment-571359160 - which should pretty much always work because pedantic only has that one function in it code wise.
Thanks @dnfield. No problem. Will do the override.
@dnfield Yeah, I'll close this.
IMHO, it is a mistake for any package to ever have a direct non-dev depdnency on pedantic. The package offers only one function that is exactly this:
Please don't suggest that people copy and paste as an alternative to adding a dependency. There's nothing wrong with small packages. Flutter not complying with semver is a bug, copying and pasting is a workaround, not a good practice.
Is this intentional? We need to wait until the Flutter test SDK uses 1.9.0 before we can use it in our projects?