AngeloAvv / flutter_flavorizr

A flutter utility to easily create flavors in your flutter application
https://pub.dev/packages/flutter_flavorizr
MIT License
456 stars 81 forks source link

How to turn off processors? #225

Closed subzero911 closed 9 months ago

subzero911 commented 10 months ago

flavorizr always generates default App widget and Pages folder; I don't need it. I suppose that I should turn off the following processors:

flutter:app
flutter:pages

How can I do it?

It also overwrites my main.dart with its custom content, I want to turn it off too, but leave main_dev.dart and main_prod.dart.

burakoztermt commented 10 months ago

I ran into same situation when I realized that this package creates a lot of files and overwrites the existing ones.

So here is what I did; I copied all the default processors Processors Set and delete the ones I don't need. E.g. flutter:app and flutter:pages . No pages created and app.dart was not overwritten.

subzero911 commented 10 months ago

I ran into same situation when I realized that this package creates a lot of files and overwrites the existing ones.

So here is what I did; I copied all the default processors Processors Set and delete the ones I don't need. E.g. flutter:app and flutter:pages . No pages created and app.dart was not overwritten.

Can I read processors from file somehow, to not to enter them in a command line one by one?

burakoztermt commented 10 months ago

I ran into same situation when I realized that this package creates a lot of files and overwrites the existing ones. So here is what I did; I copied all the default processors Processors Set and delete the ones I don't need. E.g. flutter:app and flutter:pages . No pages created and app.dart was not overwritten.

Can I read processors from file somehow, to not to enter them in a command line one by one?

This is also my first time using this package so I will try to answer best to my knowledge.

Just by looking at the source code here; entrypoint/run.dart, it is not possible to read processors from a file. It only reads processors from the command line. However, it shouldn't be too difficult to change that source code file to your need and read from a file.

AngeloAvv commented 10 months ago

I ran into same situation when I realized that this package creates a lot of files and overwrites the existing ones. So here is what I did; I copied all the default processors Processors Set and delete the ones I don't need. E.g. flutter:app and flutter:pages . No pages created and app.dart was not overwritten.

Can I read processors from file somehow, to not to enter them in a command line one by one?

Yes, you can. You can specify a custom set of instructions as mentioned in the README. Here's a list of instructions: https://github.com/AngeloAvv/flutter_flavorizr#available-instructions

Keep in mind some of them are mandatory to make other instructions work properly.

burakoztermt commented 10 months ago

I ran into same situation when I realized that this package creates a lot of files and overwrites the existing ones. So here is what I did; I copied all the default processors Processors Set and delete the ones I don't need. E.g. flutter:app and flutter:pages . No pages created and app.dart was not overwritten.

Can I read processors from file somehow, to not to enter them in a command line one by one?

Yes, you can. You can specify a custom set of instructions as mentioned in the README. Here's a list of instructions: https://github.com/AngeloAvv/flutter_flavorizr#available-instructions

Keep in mind some of them are mandatory to make other instructions work properly.

Cool, looks like you can! @subzero911.

Added instructions array in the .yaml file and it works.

instructions: [
   "assets:download",
   "assets:extract",
   ...
]

Maybe add this to the examples with the default set? people can easily add more or remove instructions instead default is used implicitly.