Hello Flutter!

Diego Velasquez
4 min readJun 30, 2018

--

I have been developing native mobile applications for more than 7 years using programming languages ​​such as Java, Objective-C, Kotlin, Swift.
I have developed different projects from small to large scale projects and also I have two own apps in the PlayStore developed in Android native.

Previously, the only solution for a company to have its application available on both platforms was to develop the application natively, for both Android and iOS.
Also emerged hybrid applications, using frameworks and tools such as PhoneGap (Cordova), Jquery mobile, iONIC, Sencha Touch among others. The user experience was not good, for performance (Running in an embedded browser) and limitations such as access to hardware for example.

Then more advanced multiplatform frameworks that could have great performance were coming out because they could generate native components, among them are Xamarin and React Native.
Last year Google showed us a new multiplatform framework created by them called Flutter, which uses the Dart language and allows you to create applications that run on Android and iOS.

In this post I will talk a little about my experience with Flutter, being a native Android developer.

Why I decided to go with Flutter?

It all started when in the company where I worked we made an application to manage events that we organized with the public in general, the application we have in Android and native iOS, to develop it we required a native developer for each platform, because we are all assigned to some project, we had to use our free time to develop the new features or fixing bugs.

We had some problems in the last version that we launched, because the user interfaces were very different in each platform, some features were not ready in Android but in iOS, or also in reverse. The same happened with bugs.

From there moment my interest in taking a look at the new Google framework called Flutter grew, I started from the following link: https://flutter.io/
Downloading the SDK, the IDE that I chose was Visual Studio Code, which is very, very light and easy to use, you can also use Intellij, or the same Android Studio with a Flutter plugin.

The learning curve of the Dart language was almost zero, because I have a lot of experience with Java, and Dart is similar like Java/Javascript.
I started playing with the example that Flutter tries when creating a project, the creation of interfaces is all in code, you can think that it is very time consumer, but in the end you find that it is more productive due to the incredible characteristic that Flutter has, which is the HOT RELOAD! , you can see your changes in 1 or 2 seconds after saving, this saves you a lot of time instead of having to save, deploy and wait that it can be between 1–3 minutes depending on the hardware you have.
They have also created a visual interface designer, you can see it here (not from the Flutter team): https://flutterstudio.app/

Then I started to see some architectures and patterns used in Flutter, since in Android/iOS I was used to implement Clean architecture with MVP or MVVM, then I found this link where there are many examples which one can follow and adapt: ​​https://github.com/brianegan/flutter_architecture_samples

I started migrating the application to Flutter, doing basic functionalities, and the result was amazing, it took me less than a week to do 30% of the application while still learning Flutter.
The application required a QR Scanner, in Flutter there are many Plugins available that allow interaction with the hardware of the device, in this case the camera, the integration was super simple, only with less than 10 lines of code already had a QR scanner in both platforms.

Flutter App Demo 1

It is also possible to create Plugins to be able to communicate native code of each platform with Flutter, in the case you require it, everything is done through ‘Channels’.

The application has the same performance as the native apps, and visually looks great, Flutter respects the behavior on each platform, ie, as the navigation bar-toolbar, listview-tableview (the scroll / bounce is according to each platform), navigation behavior when you swipe from left to right in iOS to go back.

For the time being, I will continue to learn and use Flutter as long as it suits the needs of the project.

Conclusion

One as a native developer often rejects the use of cross-platform tools, but at a certain point you have to think a bit about the client’s side in order to suggest options that fit according to the budget you have.
We also have to evaluate the complexity of the application, for a very complex application with intensive use of external hardware connection it may not be a good idea to use this.
But for other types of project, I think it could fit perfect, according to your needs. In the next post I will be posting parts of code on how to implement things that we do in native Android/iOS.

--

--