| // Copyright 2014 The Flutter Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| package com.yourcompany.flavors; |
| |
| import android.os.Bundle; |
| |
| import androidx.annotation.NonNull; |
| import io.flutter.embedding.android.FlutterActivity; |
| import io.flutter.embedding.engine.FlutterEngine; |
| import io.flutter.plugin.common.MethodCall; |
| import io.flutter.plugin.common.MethodChannel; |
| import io.flutter.plugins.GeneratedPluginRegistrant; |
| |
| public class MainActivity extends FlutterActivity { |
| @Override |
| public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { |
| GeneratedPluginRegistrant.registerWith(flutterEngine); |
| new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), "flavor") |
| .setMethodCallHandler( |
| (call, result) -> { |
| result.success(BuildConfig.FLAVOR); |
| } |
| ); |
| } |
| } |