Reputation: 4453
I'm new on Flutter but I'm Android developer.
When I created a new Android project. I always prepare two build variant debug
and release
which provide me a BuildConfig.DEBUG
variable with the value depended on which build variant I choose. I'm not sure about iOS. However, when I created a new Flutter project, I cant find the ways to point the gradle build me something like that.
Example code:
class RikimaruApplication extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "Rikimaru Application",
theme: ThemeData(),
debugShowCheckedModeBanner: false, \\ => debugShowCheckedModeBanner: BuildConfig.DEBUG,
);
}
}
I searched Google with flutter build variants
key word but fail. Please teach me how to research about this problem.
Upvotes: 2
Views: 7909
Reputation: 2430
there is no magic bullet for that. and it's easy i think.
you can use this link that is suggested by google :
https://medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
and it can be in few steps :
-Creating new config files in flutter app ( each can have flavor to run ) .
-having that "Build flavor" name in android and ios .. android should be productFlavors...ios should be Schemas .. choose config for run in flutter and Well Done!
Upvotes: 0
Reputation: 103
The keyword word would be flutter flavour
And you can check this link for more information on flutter flavouring.
Upvotes: 1