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

`flutter run` loads Monarch instead of its given target #29

Closed fertrig closed 2 years ago

fertrig commented 2 years ago

Running flutter run -t my_main.dart after running monarch run will load the Monarch main file instead of the given target, e.g. my_main.dart.

This issue only affects users of Monarch running Flutter version 2.5.x and whose projects use certain plugins. Previous Flutter versions work as expected.

This issue is due to a Flutter issue, when https://github.com/flutter/flutter/issues/90920 is fixed, this issue will be fixed as well.

Workaround: delete file .dart_tool/flutter_build/generated_main.dart before running flutter run.

Steps to reproduce

  1. You are on Flutter 2.5.x
  2. Your project uses a package like path_provider which uses plugins
  3. Run monarch run
  4. Wait for Monarch to load your stories
  5. Run flutter run -t my_main.dart, where my_main.dart is the main file of your app
  6. The app will load Monarch's main file and you will see some Monarch messages printed on the terminal. The expected behavior is that flutter run -t my_main.dart should load my_main.dart.
vinceramcesoliveros commented 2 years ago

The issue is now fixed yesterday. Just bumping this issue. 👍

fertrig commented 2 years ago

Thanks for the heads up @ram231!

The fix, which is part of Flutter 2.7.0-3.0.pre in the beta channel, works as expected.