Description
Hello! I've been running into this bug more and more as I work on projects that contain some Flutter directories along-side plain-old-Dart projects or Angular Dart projects.
Use-case: I have a project with 3 directories:
app_base
: Pure Dart lib to be shared by an Angular and Flutter appapp_flutter
: Flutter app that relies on app_baseapp_angular
: Angular app that relies on app_base
When I try to run tests in app_base
, I get the following error:
Running "flutter packages get" in app_base...compiler message: Error: Could not resolve the package 'flutter_test' in 'package:flutter_test/flutter_test.dart'.
Which makes sense -- app_base
shouldn't depend on Flutter! However, it seems like once you set the Flutter SDK for a project, it tries to run all tests as if they were Flutter tests. It would be great if the Flutter plugin either:
- Allowed me to select which directories in my Project are Flutter directories (similar to the Dart plugin)
- Understood the current directory is a Dart project, not a Flutter project, and ran good ol' Dart tests in that case
Workaround
Create a Run config for Pure dart tests. This quickly becomes cumbersome, however -- if I want to run/debug a single test in a single file, I always need to create a new run config rather than allowing the IDE to run an erroneous flutter test
Thanks!