Tomáš Repčík - 2. 11. 2022

Deciding between Flutter and Native Android/iOS Development

It is not about which one is better but which one suits the project

Nowadays, mobile development can be done in multiple environments like Kotlin/Swift, Flutter, Kotlin Multiplatform, React Native, Xamarin and others. However, picking the best one is a hard decision to make. So if you made it to this point, when deciding between Flutter and Kotlin/Swift, I would try to clarify and make it easier. Making the right decision can save a lot of headaches and hours.

Image created with help of icons from iconfinder. Thanks to: Kotlin icon, Swift icon and Flutter icon.

What kind of project is ahead of you?

In general, mobile app belongs to one of two categories. First, the app provides service to the user. Second, the app is a product on its own.

The app as a service acts as a middleman providing information, feed, and multimedia to the end user. It does not rely heavily on the components/resources of the phone because the main job is done outside of the phone. The point of marketing is not the app but the service which the app provides.

The apps as services are social media, shopping, management and organisation, finance apps, and others.

The app as a product is a selling point on its own. The person buys/downloads the app because he wants to use a combination of available software features and the ability to use phone resources/convenience.

The apps as products are activity tracking apps, multimedia editors, phone tools apps, and others. Simple games could be created in both implementations, but advanced games should use more complex engines.

Why does it matter?

The pros and cons of Flutter and native implementations come into play.

When to use Flutter?

Flutter is perfect for apps which act as services. UI is composed by putting widgets into trees with components provided by Flutter. A plethora of material-designed Flutter components is available out of the box. All the widgets can be easily styled and the theming system comes with it. Structuring is easy and does not require a lot of learning.

Performance-wise, asynchronous nature of the dart language makes it easy to create repository calls. Even though the app is slightly larger than usual, performance is rarely the issue. If you do not put too much burden on the main thread, the Flutter app will work smoothly. A computational job can be put on other threads called isolates which will make the app smooth again.

What is the problem with Flutter?

Flutter will provide you with all the necessary tools. However, if it comes to interactivity with native phone APIs, you can run into issues. Flutter is driven by a great community, Google and packages created by them. They can be found here on pub.dev. They have become an irreplaceable part of the Flutter. You can find databases, access to phone’s API like GPS, storage and others. Frankly, it is its strong and weak point at the same time.

On the one side, packages can make your life much easier. You can pick the package and put it into the dependencies with one line. A couple of lines of code can solve your problem.

On the other side, sometimes you need to do something so specific that you will not be able to find a proper package. Moreover, it can be deprecated, buggy, not well maintained or incompatible with some of the devices or Flutter versions.

Despite this fact, do not get discouraged. Plenty of packages are well-maintained and must be kept up to date because they cover basic functionalities. Look for packages with high ratings and it should be fine.

When to use Kotlin/Swift

If the app is planned as a product on its own, then native development is a better choice. As it was mentioned, the packages cannot cover all the required features. Fortunately, the native API interfaces provide you with complete control of the device. You are limited only by the operating system itself. With the arrival of SwiftUI and Jetpack Compose, the mindset required to build UI is principally similar to Flutter if we do not consider syntax changes.

Performance should not be an issue, as the usage of different dispatchers is available on both platforms. Unfortunately, you have to write the code twice in Swift and Kotlin to produce two apps. Moreover, the learning curve can be steeper because of the higher complexity of the environments.

Is there a compromise?

Yes, there is one! You can you Flutter and communicate with native environments with binary bridges, pass native views into Flutter or launch new Android activity or iOS sheet. So, partially, you can avoid writing a lot of native code, but still requires knowledge of all languages.

You can read more on multiplatform development at Flutter documentation here.

Subscribe for more
LinkedIn GitHub Medium Threads X Bluesky