-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Description
We need a way to be able to just have a pubspec.yaml
, a lib/main.dart
, and perhaps a .metadata
file, and be able to flutter run
a project from only that. One way to do that would be to have flutter run
auto-create the missing platform directory for the platform that the user is attempting to run on, either right in the project directory, or (probably better) in a temp area, perhaps inside the build dir.
The use case is that I'd like to be able to have "bare" projects that don't have any platform directories in them by default, so they can be checked in that way without all the boilerplate, and whenever they are run, they get the latest platform code for the version of Flutter running them.
This won't work for any app that needs customization, of course, but I do think there are a lot of "examples" and simple apps that could benefit from this kind of setup. One place where this would help is to eliminate the stale boilerplate code in the Flutter repo itself, including a bunch of legacy icon binaries that we'd rather not have in the repo in the first place.
Also, if this was the default mode of flutter create
, when someone first encounters of a Flutter project, their first impression would be that of something pretty clean and simple, instead of a lot of arcane boilerplate that they probably don't understand or understand the need for (yet).
Some challenges to this proposal would be:
- It would mean adding a way to write the platform boilerplate in a permanent location so it could be modified.
- We'd need to make sure that changing the
flutter create
default behavior doesn't mess up the IDE integrations. - Projects that don't support a particular platform will no longer be able to indicate that just by not creating a platform directory for it: Flutter would just attempt to run there and fail.
- The method of converting from temporary to "permanent" platform directories needs to be discoverable, and we'd need to educate users as to when that is necessary.
I know we used to have something similar, with the .ios
and .android
ephemeral directories, and we removed them. I can't remember exactly why, but perhaps we can avoid the pitfalls of that?