Dropsource / monarch

Monarch is a tool for building Flutter widgets in isolation. It makes it easy to build, test and debug complex UIs.
https://monarchapp.io
MIT License
437 stars 22 forks source link

package version conflict with freezed 0.15.0+1 #30

Closed kaznak closed 2 years ago

kaznak commented 2 years ago

I had installed monarch 1.0.1 through the monarch init command into a clean flutter repository and added the Freezed package by hand then met a package version conflict error as following:

[test_app] flutter pub get
Running "flutter pub get" in test_app...     
Because freezed >=0.14.1+3 depends on build_config ^1.0.0 and build_runner ^1.12.0 depends on build_config >=0.4.7 <0.4.8, freezed >=0.14.1+3 is incompatible with build_runner ^1.12.0.
And because build_runner >=0.9.1+1 <1.12.2 depends on dart_style ^1.0.0, if freezed >=0.14.1+3 and build_runner >=0.9.1+1 <2.0.0 then dart_style ^1.0.0.
And because monarch >=0.1.3 depends on dart_style ^2.0.0 and test_app depends on freezed ^0.15.0+1, build_runner >=0.9.1+1 <2.0.0 is incompatible with monarch >=0.1.3.
So, because test_app depends on both monarch ^1.0.1 and build_runner ^1.10.3, version solving failed.
pub get failed (1; So, because test_app depends on both monarch ^1.0.1 and build_runner ^1.10.3, version solving failed.)
exit code 1

The dependencies in pubspec are as following:

dependencies:
  freezed: ^0.15.0+1
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^1.0.0
  monarch: ^1.0.1
  build_runner: ^1.10.3

And updating build_runnder to the latest version(2.1.4) suppressed the above error.

Can I update build_runnder safely? And please update the version of monarch init command.

Monarch is very helpful for me. Thank you for developing and reading this!

fertrig commented 2 years ago

It seems you are running flutter 2.5.x, so yes, you can update build_runner to ^2.1.4. Monarch will work fine.

If you were on flutter 2.4.x or earlier, then you would have to use the older build_runner ^1.10.3 and freezed 0.14.1+2.

We are about to release an update that will initialize build_runner based on the project's flutter version.

Thanks for letting us know about this issue and we are glad you find Monarch helpful!

fertrig commented 2 years ago

The command monarch init in the latest Monarch release sets up the monarch packages versions based on the project's flutter version: https://monarchapp.io/blog/newsletter-01

kaznak commented 2 years ago

It works! thank you!