objectbox / objectbox-dart

Flutter database for super-fast Dart object persistence
https://docs.objectbox.io/getting-started
Apache License 2.0
981 stars 119 forks source link

Flutter analyzer 2.0.0 support #300

Closed w461 closed 2 years ago

w461 commented 2 years ago

Any plans when ObjectBox will support analyzer ^2.0.0?

I personally, appear to urgently need using analyzer 2.0.0. I cannot reliably start my new app, most probably caused by the dependency injection get_it package. A fix is available in the lastest release, however, that requires 2.0.0

So some outlook when this will be available is most welcome

vaind commented 2 years ago

I've updated the generator's pubspec.yaml to support analyzer 2.x - this will come out in the next release. In the meantime, you can add a dependency override to your app's pubspec.yaml:

dependency_overrides:
  analyzer: 2.0.0
w461 commented 2 years ago

Thanks for the quick response. So basically you are saying that the current version already supports analyzer 2.0.0, it just doesn't know the version?!

vaind commented 2 years ago

current pubspec of the released objectbox-generator has the dependency defined as analyzer: ^1.1.0 which means it only works for any 1.x version. I've tested the generator with analyzer 2.0 and it works so I've increased the supported range to analyzer: '>=1.1.0 <3.0.0' to keep supporting 1.x and add support to 2.x as well. Before that is released in the next objectbox-dart version, you can override the analyzer version you use, regardless what your dependencies expect, by the dependency_overrides section, as stated above.

w461 commented 2 years ago

Cheers, than I understood your initial response correctly

vaind commented 2 years ago

:+1:

yes, it "supports" as it works with it. but didn't support yet from the point of the dependency specification, because back when objectbox-dart 1.1.1 was released, the latest analyzer was 1.7

vaind commented 2 years ago

v1.2 is out, you can remove the override and upgrade