File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
kotlin/com/example/flutter_flavors Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,21 @@ android {
5252 signingConfig signingConfigs. debug
5353 }
5454 }
55+
56+ flavorDimensions " app"
57+
58+ productFlavors {
59+ dev {
60+ dimension " app"
61+ applicationId " at.chwe.flutterflavors.dev"
62+ resValue " string" , " app_name" , " DEV Flutter Flavors"
63+ }
64+ live {
65+ dimension " app"
66+ applicationId " at.chwe.flutterflavors"
67+ resValue " string" , " app_name" , " Flutter Flavors"
68+ }
69+ }
5570}
5671
5772flutter {
Original file line number Diff line number Diff line change 77 FlutterApplication and put your custom class here. -->
88 <application
99 android : name =" io.flutter.app.FlutterApplication"
10- android : label =" flutter_flavors "
10+ android : label =" @string/app_name "
1111 android : icon =" @mipmap/ic_launcher" >
1212 <activity
1313 android : name =" .MainActivity"
Original file line number Diff line number Diff line change 11package com.example.flutter_flavors
22
3+ import androidx.annotation.NonNull;
34import io.flutter.embedding.android.FlutterActivity
5+ import io.flutter.embedding.engine.FlutterEngine
6+ import io.flutter.plugin.common.MethodChannel
7+ import io.flutter.plugins.GeneratedPluginRegistrant
48
59class MainActivity : FlutterActivity () {
6- }
10+ override fun configureFlutterEngine (@NonNull flutterEngine : FlutterEngine ) {
11+ GeneratedPluginRegistrant .registerWith(flutterEngine);
12+
13+ MethodChannel (flutterEngine.dartExecutor.binaryMessenger, " flavor" ).setMethodCallHandler {
14+ call, result -> result.success(BuildConfig .FLAVOR )
15+ }
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments