create method channel after upgrading flutter- can not resolve method getFlutterView() : <p>i was using native android method in my flutter app using documentation which said use</p>

<pre><code>MethodChannel(flutterView, CHANNEL).setMethodCallHandler...
</code></pre>

<p>but after upgrading flutter the <code>MethodChannel</code> function does not require <code>flutterView</code> and
there is no <code>flutterView</code> anymore.</p>

<pre><code>can not resolve method getFlutterView()
</code></pre>

<p>i think there should be a new tutorial for creating channel</p>

<p>instead it needs some <code>BinaryMessenger</code> which i don't know what to give instead.</p>

<p>this is the old code which is not working anymore:</p>

<pre><code>import io.flutter.app.FlutterActivity;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;

public class MainActivity extends FlutterActivity {
private static final String CHANNEL = "samples.flutter.dev/battery";

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    GeneratedPluginRegistrant.registerWith(this);

    new MethodChannel(getFlutterView(), CHANNEL).setMethodCallHandler(
            new MethodCallHandler() {
                @Override
                public void onMethodCall(MethodCall call, Result result) {
                    // Note: this method is invoked on the main thread.
                    // TODO
                }
            });
}
</code></pre>
