0

How should I add this package to pubspec? Thank you! enter image description here

Cristian F. Bustos
  • 473
  • 1
  • 8
  • 17

2 Answers2

2

This is the simplest way to install any package

  1. Search and open package page on https://pub.dev/
  2. Click on the Installing tab
  3. 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.

Doc
  • 10,831
  • 3
  • 39
  • 63
1

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.

HBS
  • 580
  • 3
  • 6