DEV Community

Cover image for The Flutter Developer and the importance of native knowledge
Pedro Bueno for Cuscuz com Código

Posted on

The Flutter Developer and the importance of native knowledge

Hi, this article is an introductory and a little bit more theoretical. My purpose is to initiate a discussion about the need for studying mobile native development (iOS and Android native). I am available to chat about it on my Linkedin, my user is in/arcbueno

Almost a year ago,I started a post-graduation degree in Mobile Application Development. My purpose was deepen my knowledge in the study area that I want to be a specialist, focusing on what I didn’t know, because a lot of what I already do in my work was self-taught and my studying was dependent on what was required of me in the current project. If I didn't look for specific topics I would never have learned them, but to start, which topics? Native development first.
I have been working as a Android developer for 1 year before I started working with Flutter, but nothing too specific, just maintenance on an app that already existed. But it was working with Flutter that I really understood the importance of knowing Kotlin and Swift development (or Java and Objective-C if you prefer). And it’s about that importance that I would like to talk.

The native was already here before Flutter
It sounds like it's an obvious statement, but we should understand what it means: if native development already exists, so other applications, libraries and documentation were created before. We have many apps built, documentation written and active communities for questions, which makes it easier if your app needs to work with specific tools, such as gyroscope or accelerometer, for example.

This advantage also extends to its libraries as well, that they already tested and it is in use for long years, just in case that you are insecure about using that lib that only 10 people like and barely have 100 downloads on pub.dev.

It's normal to a programmer to sometimes “work on a deeper level” and work on something with more complexity. But if you need to go to native development, you will be glad to know the number of things that are already done.

Understand the configs helps a lot
When developing mobile applications its common the use of “flavorsˮ or developing environments (dev, staging, production), but Flutter creates apps for iOS, Android, Web, Windows… what to do?

That's why it's important to know how to configure, or at least understand the structure of an iOS and Android project. What the info.plist file does? What is this gradle that always complains to me when I add a new setting?

Yes, I know, you don't spend all of your day working on Android SDK version or cocoapods updates, but sometimes you'll have to have some contact with it and knowing its existence will help a lot. I'm not talking about someone that started studying mobile development less than a year ago and is still divided on which state management method to use. I'm talking about turning in an experienced developer that is capable of solving problems, even because there will be a time that the Apple's App Store will require a new setting and you need to understand what it may affect.

MethodChannels
In another moment I may talk about the technical part of MethodChannels, but, to resume, it's a feature of Flutter that allows your hybrid app update data with the Kotlin or Swift code (or C if you are working for desktop).

This is the center of our motivation, the “howˮ communicate with the native framework, because, as I already said, in some moment you'll have to.

An experience that I had was when I worked to an e-commerce platform, the company made a contract with a company of payment tools, but this tool's SDK only had support to Android and iOS, because Flutter was still a bit new for some companies. In this case, I had to use the native frameworks: I developed service classes and listeners to communicate with the Flutter app using MethodChannels.

It was an specific case, I know, but I will never forget that my lack of knowledge turned a 3 to 5 days work into 2 weeks work. This was a reminder that native development study isn't only a "plusˮ but will be the difference between delivering on time or a costly delay.

Higher accuracy on hardware data
Working with Flutter is cool, developing a code and running on Android and iOS devices without major problems helps the developer a lot, but we often have a hard time when accessing hardware data, as gyroscope or accelerometer or bluetooth, for example.

This difficulties are, in general, the performance to access data, or accuracy or a stable connection (in the bluetooth case). However, the use of MethodChannels + native development turned this way easier.

And we have to be fair: the files size are smaller and general performance of native are better. The hybrid development is easier and more practical, of course, but it's not that recommended for some application types for a reason. The communication with native development is the solution to bypass this cases.

So I should give up on Flutter and start being a native framework developer?
I don't mean that, I love Flutter, how it is growing and reaching popularity for many other reasons that are well structured. The Flutter framework has a lot of qualities that already influenced other languages like it made it easier the writing of UI, fast understanding and easy configuration. We just need to get the possible problems and bring it solution.

Conclusion
Sure, let's be fair, a developer that has 10 years of experience in mobile development already had contact with what we saw, but the ideal is that we don't need 10 years to have this understanding. Knowing how to solve problems is our job as developers and understanding that there isn't a “silver bulletˮ for everything when developing software is essential. Ultimately, it's not about choosing one or the other, but about expanding your arsenal of tools to become a truly well-rounded programmer.

Portuguese text: https://medium.com/cuscuzcomcodigo/o-desenvolvedor-flutter-e-a-import%C3%A2ncia-do-conhecimento-nativo-347d03b98abc

Top comments (0)