-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Description
Use case
Developers wanting to transform assets, based on the current target platform (i.e. flutter build web
-> web; flutter build apk
-> android), currently cannot infer the target platform during the asset transformation.
Proposal
I propose that the target platform of the flutter build
invocation is provided as either an argument, or in Platform.environment
. I initially tried checking what is inside Platform.environment
and the FLUTTER_BUILD_MODE
seems to be there already?
Then I think the easiest thing to do is to also add something like FLUTTER_BUILD_TARGET_PLATFORM
to Platform.environment
or the args that are passed to the asset transformer, whichever makes more sense / is cleaner from a tool perspective.
Context: I was initially exploring if I could work around the absence of #141371 using an asset transformer