CocoaPods
are solved in a similar way.

Even if some_package and another_package
declare incompatible versions for url_launcher,
they might actually use url_launcher in
compatible ways. In this situation,
the conflict can be resolved by adding
a dependency override declaration to the app’s
pubspec.yaml file, forcing the use of a particular version.

For example, to force the use of url_launcher version 5.4.0,
make the following changes to the app’s pubspec.yaml file:

dependencies

some_package

another_package

dependency_overrides

url_launcher

5.4.0'

If the conflicting dependency is not itself a package,
but an Android-specific library like guava,
the dependency override declaration must be added to
Gradle build logic instead.