In this article, we will tackle Connecting Flutter to your Native Android Project.

I know some of you think that this is impossible but now, it’s possible! Also, you can connect it to your existing projects too!

We all know that it’s not practical to recode the entire application. For these circumstances, Flutter can be integrated into your native project for both Android and iOS.

Things that you need :

  • Native Android Project (New or Existing Project)
  • Flutter
  • Emulator or Actual Device
  • IDE/s (Android Studio and VS Code)

Native Android Project

  1. Create a project.
  2. Let’s add button in your MainActivity

Image for post

We added a button which we set its width and height to the length of the text, centered it to the middle of the screen and set it’s onClicked identifier to trigger the button’s functionality.

3. Let’s add the functionality of the button.

Image for post

As you can see, I added **_onClickedButton() _**inside of the MainActivity.kt for the functionality of the button that we created from the XML.

So, if you run this to your emulator or device. You could see something like this.

#kotlin #google #mobile-app-development #flutter #dart

Connect Flutter to your Native Android Project
4.70 GEEK