Introduction to add Flutter to an existing Android App

Dave Chao
2 min readJun 14, 2021

--

It’s sometimes not practical to rewrite your entire application in Flutter all at once. For those situations, Flutter can be integrated into your existing application piecemeal, as a library or module. That module can then be imported into your Android app to render a part of your app’s UI in Flutter.

Get Started

Add a single Flutter screen

First, we need to add FlutterActivity to AndroidManifest.xml.

Next, we use a cached FlutterEngine to launch FlutterActivity.

Add a Flutter Fragment

We just add a FlutterFragment to an Activity with a cached FlutterEngine.

Add a Flutter View

FlutterView can be added to any Android native view.

First, we need to create a cached FlutterEngine.

Next, when the FlutterView is added to a resumed Activity’s view hierarchy and is visible, call attachToFlutterEngine.

Add a Flutter View in RecyclerView

Thanks for reading this and I hope this helped you add Flutter to your existing Android App project. You can find the code for this tutorial on my GitHub.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Dave Chao
Dave Chao

No responses yet

Write a response