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
flutter create --template=package creates platform folders #119844
Comments
Same problem here. |
Related #116320 |
They may be needed in case of platform dependent code (e.g. platform channels) -- don´t they? So a full template needs to setup all platform folders. |
That would be true for plugins, which are effectively packages + native code. Packages are generally pure Dart. |
Minimal dart package: You can add flutter sdk in dependencies:
flutter:
sdk: flutter |
Thanks for the report. Seeing same behavior as reported. This document gives overview of some of the files generated using the said command, but nothing much on the folders created with it. With this though for plugin to create, we specify platforms for which the plugin need to support and hence the respective folders are created. stable, master flutter doctor -v
|
Thanks for comments. |
Yes this is true but this package can't depend on Flutter related things (for example, creating any feature ui with material and cupertino components in this package and so on), but in the normal case we would create package that can use Flutter related codes too. |
Although I didn't know about this template, it seems a valid use case where you want to author a package that calls dart:ui. |
if this platform specific packages are supposed to be generated, please allow at least to configure them via |
The |
Same problem here. |
`package` template should not create platform folders. This happen cause by default all platforms are supported and tools didn't distinguish between package and other template, which makes all platforms are true for below code, https://github.com/flutter/flutter/blob/d186792c00f61149916f685e2975300342f64749/packages/flutter_tools/lib/src/project.dart#L374-L380 fixes: #119844 which make #116320 makes invalid. As for why tools created deprecated `Android Embedding`, `appManifestFile` does not exist for `package` template, which make below code to trigger, https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/project.dart#L768-L770 This does not happen with `module` and `plugin` as it have specific condition check for them. I try to reproduce it with `app` template but didn't succeed
why is this issue not resolved in Flutter version 3.10.0 ? |
because it was merged after Flutter 3.10 branched. See https://github.com/flutter/flutter/wiki/Where%27s-my-commit%3F for more context. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
flutter create --template=package package_name
Expected results:
When we create package, I assume that it should only create dart files.
Actual results:
But unfortunately, it creates all platform folders -
android
,ios
,macos
and etc. I have tried to create package from Android studio, VS Code and even with flutter command.Logs
The text was updated successfully, but these errors were encountered: