
- 473
- 1
- 8
- 17
-
What are "y" and "x"? – Christopher Moore Aug 03 '20 at 19:42
-
It says it on the page https://pub.dev/packages/connectivity – Cristian F. Bustos Aug 04 '20 at 00:10
-
Those are general placeholders for a version number. That's not actually meant to be used. – Christopher Moore Aug 04 '20 at 00:23
2 Answers
This is the simplest way to install any package
- Search and open package page on https://pub.dev/
- Click on the
Installing
tab - Copy the line and add to
pubspec.yaml
So in your case go to https://pub.dev/packages/connectivity/install and paste the code.
Currently it is connectivity: ^0.4.9
. Use 2 spaces for indentation.
In general
Given a version number MAJOR.MINOR.PATCH
, increment the:
MAJOR
version when you make incompatible API changes,
MINOR
version when you add functionality in a backwards compatible manner, and
PATCH
version when you make backwards compatible bug fixes.
so, increase PATCH for bug fixes. increase MINOR for new features without breaking old code increase MAJOR when using it will break old code.

- 10,831
- 3
- 39
- 63
Add this to your package's pubspec.yaml file:
connectivity: ^0.4.9
If you want to add constraints, replace the x and y with the lowest version you want, such as 0.4.8+6. See the plugin’s pub.dev page for more versions.

- 580
- 3
- 6