A Brief Introduction to Flutter

Zubair Rehman
4 min readOct 6, 2018

--

Now is an incredible time to be a mobile developer. Smartphones, tablets, and smart watches have become an important part of our lives, and Android and iOS keep getting better and adding new features at each new release. Great new frameworks help developers build apps faster and more reliably, and Flutter is, of course, one of those frameworks. Flutter is Google’s new mobile app toolkit for crafting beautiful native interfaces on iOS and Android in record time.

Why Flutter?

We could write hundreds of pages on the different ways to develop for mobile platforms. To make it really brief and simplifying a great deal, we have three major ways to develop for mobile, native, hybrid, and web.

Native

Native means that we use the native official tools, and today, that means Android Studio with Java or Kotlin coding for Android and XCode with Swift or Objective-C for iOS. Android Studio and XCode with their supported languages are both great tools, tried and tested. They get new features as soon as they are available. They build fast and efficient apps using all the device capabilities natively, but they share one major disadvantage. If you want to build an app for both iOS and Android, you need to create and maintain two apps, one for each platform, and you need to know at least two languages.

Web Apps

At the other end of the spectrum, we have web apps. We can access them from a browser and web apps lets us share the same code for both mobile and web development. This is great for developers who use HTML, CSS, and JavaScript. Only one code for any system, easy to use, easy to implement with one major flow. You cannot reach the device more advanced features and the user may feel your app isn’t really an app. It’s just a website really in the form of an app. Even if there are tools to overcome some, but not all of the limitations right now.

Hybrid

And there’s a third way. Tools like Xamarin, Cordova, Ionic, Reactive Native, just to name a few, those are called hybrid. Each of them has some advantages and disadvantages, but all these frameworks lets us build our apps with a single code base for mobile. They generally use some form of JavaScript, except for Xamarin that uses C#. The problem with most of them is they need a bridge between code and the mobile operating system and some of them have performances that are well below the level of native apps. Not only that, but in some cases, the complexity of using several third-party libraries and components with their compatibility issues can make the developer life a nightmare. Believe me when I say that I’ve been there.

Where does Flutter fall then?

In the hybrid category with a couple off features that Google believes can make the difference. The first one is that Flutter compiles to native for excellent performance. Actually, Flutter has two different compilation models. Just-in-time compilation where code is recompiled in real time allowing hard reload. This means that when we develop, we see the changes in real time with no need to recompile. You write the code and you see the results immediately on your device or emulator. Then we have ahead of time compilation. Code is compiled to native arm code for great performance on any device.

Flutter has been created to give developers a fast development framework, and to users, a great engaging and fast experience. And of course, you’ll have a single code base for both iOS and Android. Another difference from other hybrid frameworks is that with Flutter you don’t have bridges between your code and the device and this is another feature that can make Flutter stand out from some of its competitors. Actually, Flutter is a very young framework. It was announced at Google I/O in May 2017 with an alpha toolkit and at Google I/O 2018, the third beta was announced. So now, according to Google, Flutter is ready for production apps. Even if it’s production ready, there may be some major changes in the future.

Dart as a programming language

When we develop for Flutter, we use a language called Dart. It’s a strongly-typed object-oriented programming language developed by Google. If you don’t know Dart, don’t worry. If you are familiar with C#, Java, Swift, TypeScript, or even JavaScript, you’ll have no problems at all with Dart. You’ll see that it’s intuitive and easy to learn.

Pre-requisites

So what do you need to know before starting? Well you need to know any object-oriented programming language. If you understand variables, control flow, inheritance, classes, and objects, you’re good to go.

And what do you need to have? You can use a Windows PC, a Mac, or a Linux box with your favorite text editor (I personally prefer android studio). You’ll also need an Android device or emulator and if you are on a Mac, you can also use an iOS device or a simulator.

That’s all for now. I hope this article gave you good introduction about Flutter.

Useful Links

--

--