force pub get to get latest from git

In your pubspec.yaml, you can specify a particular git commit:

dependencies:
  http2:
    git:
      url: https://github.com/dart-lang/http2.git
      ref: c31df28c3cf076c9aacaed1d77f45b66bb2e01a6

Or if you specify only a branch in "ref":

dependencies:
  http2:
    git:
      url: https://github.com/dart-lang/http2.git
      ref: master

You need to force the update with flutter packages upgrade


Use

flutter packages upgrade

to get latest.

flutter packages get

only gets latests the first time and writes the resolved versions into pubspec.lock Subsequent flutter packages get runs then try to get the versions listed in pubspec.lock,
while flutter packages upgrade always ignores pubspec.lock


  1. Run flutter clean and then pub get

  2. Ensure to update your package's version number; if the version is the same as the last commit, the package won't get updated.

  3. run pub upgrade

  4. if it still doesn't work you can run pub cache repair which reinstalls all your packages

Tags:

Dart

Flutter