I have added the flutter module in an android project, and now I want to use a different entry file for flutter based on android flavor
.
like:-
for stage flavor : main.stage.dart
prod flavor : main.prod.dart
is there any way to do that?
OR
How could I initialize environment variables in flutter based on the android flavor?
OR
While adding flutter to an existing android app, How could I use a different base URL in flutter_module based on stage
, prod
android flavor?
I haven't tried but I think you could do something like this
Create a run configuration for each flavor and write in the Additional arguments field:
Then in the dart side, you can retrieve the value in this way
And based on the value of the string flavor you can decide what to do.
if you want to build your app by console the complete command should look like this