-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't force uses-material-design: true
for root pubspec
#4486
Comments
Currently we need to have a flutter section in the root pubspec. Tracking it here: dart-lang/pub#4486
This was not a conscious decision - seems to be a bug in how flutter collects assets. I was not easily able to reproduce when I tried. What sequence of commands are you running to reproduce this? The message comes from https://github.com/flutter/flutter/blob/2dad95b21c15e41902f2ea0645d613246b364bce/packages/flutter_tools/lib/src/asset.dart#L392 |
I'm very happy to hear that this wasn't a conscious decision! I thought it would reproduce whatever you did in the repo, but that was not the case apparently, what you have to do is run flutter test packages/a If you run that in the MRE I've created here you'll get the error message: Maybe this isn't an issue at all then, it seems like it is mandatory to run |
I think so - though probably we could improve the messaging when that goes wrong. |
Thanks for the quick replies, I'll close this and fix it on the melos side. |
<!-- Thanks for contributing! Provide a description of your changes below and a general summary in the title Please look at the following checklist to ensure that your PR can be accepted quickly: --> ## Description Due to dart-lang/pub#4486 examples must run `exec` from their own directories (not sure why this wasn't the case from the beginning). ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [ ] ✨ `feat` -- New feature (non-breaking change which adds functionality) - [x] 🛠️ `fix` -- Bug fix (non-breaking change which fixes an issue) - [ ] ❌ `!` -- Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 `refactor` -- Code refactor - [ ] ✅ `ci` -- Build configuration change - [ ] 📝 `docs` -- Documentation - [ ] 🗑️ `chore` -- Chore
Aaah, now I found the real issue! So, if you have an example with Reproduction instructions: git clone https://github.com/spydon/mre_workspaces_material.git
cd mre_workspaces_material/packages/a
flutter test Result:
@sigurdm Should this issue be filed towards Flutter instead? |
I guess it is correctly filed here, because if I remove the |
Well - it has to do with how flutter accounts for assets that doesn't work well with workspaces. So the fix has to happen in flutter/flutter. But it is probably going to be me working on the fix as it is related to workspaces, so it doesn't matter hugely. |
Trying your reproduction it seems that flutter/flutter#160443 will fix this issue. |
Great to hear that there is already a fix in the pipeline, thanks! |
Environment
Problem
When you are using
uses-material-design: true
in any sub package with the new pub workspaces feature it complains that you also have to add this to the root pubspec.A monorepo can have lots of packages that aren't bound to Flutter, it doesn't seem right that the root pubspec should need to be polluted with Flutter settings just because one of its sub packages uses it?
I'm sure there was a reason for this design decision, but is there no way around it?
And I'm also curious what the reason was?
Expected behavior
Flutter settings should be contained to their own pubspecs.
Actual behavior
You get the following error:
The text was updated successfully, but these errors were encountered: