Flutter: One Codebase to Rule Them All
Do you have a revolutionary idea for the next Uber or Airbnb? Do you want native and cross-platform apps without costing you a kidney? Read on because you are going to see exactly how.
Google Trends: Flutter
let me first introduce you to Flutter, which is an extremely useful framework develop by Google to quickly develop iOS and Android mobile apps using one programming language and one codebase. It works by taking in a bunch of nested objects named "Widgets" and outputs native code for iOS, Android, the web and more. The current status queue for native mobile app development is that you need to write Objective-C or Swift to develop iOS apps and Java or Kotlin to develop Android apps, while maintaining two separate codebases for each. With Flutter, you can write using one language named Dart, and maintain one codebase instead of two, which saves tons of time and money. Therefore, Flutter should be your technology of choice if you are a startup, a lean business, developing an MVP, and/or go to market timing is critical.
History and Components of Flutter and Dart
Flutter
The first version of Flutter was unveiled at the 2015 Dart developer summit, which ran on Android OS. Initially, it was known as “Sky”, and was able to render at 120 frames per second consistently, which looked outstanding given the fact that almost all phones supported only 60 frames per second or less. This made it possible for Flutter to run at high frame rates in a consistent manner. To make this happen, Flutter uses the GPU and native graphics engines of every platform to render smooth motions that look as good as the native OS. Google is even using Flutter for the UI of its new Fuchsia operating system, which is a clear indicator of the scale of the company's investment on Dart and Flutter.
Flutter contains two vital components:
· A UI Library based on widgets. This is a collection of UI elements that are reusable (text inputs, buttons, sliders, etc.) that you can personalize according to your requirements.
· A Software Development Kit (SDK), which includes a rich collection of tools in addition to the compiler that turns your code into native machine code for iOS and Android.
Flutter is architected in such a way that it supports jank-free, glitch-free graphics at the native speed of your device. Being powered by the world-class platform, it enables compilation to native 64-bit and 32-bit ARM code for Android and iOS in addition to using the native graphics engine of each platform.
The customizability of a Flutter application is almost endless since it controls and paints every single pixel on the display. You can make iOS looking apps using the Cupertino widgets, Android looking apps using the Material widgets, or even design your own from scratch. Moreover, a single codebase does not mean single design or app dimension, Flutter automatically scales to thousands of screens to stretch your application's UI to fit virtually every display size and dimension.
Dart
The programming language that you can use to develop desktop, mobile, and web applications with Flutter is known as Dart. It is a client-optimized programming language that is garbage-collected and class-based, whose syntax is like the style followed by C. Dart can compile to either JavaScript or native code.
In October 2011, Google created Dart language, and it was unveiled at the GOTO conference in Denmark in the same year. In November 2013. Dart 1.0 was released, and it has improved significantly since then.
If you are an expert programmer, you will realize that Dart is a typed object programming language, and its syntax is similar to that of JavaScript. Dart concentrates on front-end development, and with this new programming language, you can do both client-side and server-side developments. It can also be converted into JavaScript and is compatible with most major browsers.
Flutter's Competition
Aside from the feature-by-feature comparison, Flutters offers a wide array of capabilities that are far ahead of React Native. It is as close to native performance as it gets, whereas React Native depends heavily on webviews. This makes Flutter apps look smoother and more native-like.
Some inherent features of Flutter have made it preferable to the developers instead of React Native. For instance, you will be able to make the necessary changes to the codebase on-the-fly, and at the same time you will see the impacts on these changes immediately using the Hot Reload feature. Experimenting with new ideas, fixing bugs, and adding new features are easier in Flutter than in React Native. Overall, this instant reload makes developing with Flutter a pleasant experience.
Even though it has a smaller developer community, Flutter supports many more widgets than React Native. This saves time, and a Flutter developer can easily create customizable views with these pre-made widgets. React Native on the other hand, has only some basic components supported out of box. These features are crucially important as they act as development accelerators and expedite the development process which in turn results into reduced cost and faster release time.
Some Tradeoffs of Flutter
As Flutter is still new, you will not find every functionality in its library of plugins. In that case, you will have to build them by yourself, and it will be a time-consuming process. However, the support for Flutter is improving fast as its community grows, and official support by Google is also a reassuring factor. In essence, if you have a single platform application that needs functionality that is not available with Flutter, then it might not be your best option.
Again, as Dart is a relatively new programming language, you will find it difficult to form a team with experts in Dart. However, due to its simplicity and relatively similar syntax with most major languages, Dart's learning curve is greatly reduced. If you are a serious developer, you will find that getting to know dart is not that difficult.
Applications written in Flutter are comparatively bigger than the native ones. Not to mentioned the infinite nesting of Widgets that can easily go out of control. While there is not solution to the Widgets pattern since it is built into its core design, the Flutter team is currently working actively to reduce the app size.
Examples of Apps Developed Using Flutter
Different prominent apps have been developed using Flutter. These include:
· Google Ads
· Google Assistant
· Xianyu by Alibaba
· Reflectly
· Topline app by Abbey Road Studios
· Realtor.com
· Ken ken puzzle by the New York Times
· Insight Timer
· Baidu
· Groupon
· eBay Motors
and many more..
Conclusion
Flutter is fast easy to learn framework that produces native applications for multiple platforms using a single codebase. If you are a current Android or iOS developer, you may need some time to learn Flutter and Dart, but it will be a worthy attempt, both for the opportunity to work cross-platform and also for the many features it unlocks. As the titan of the digital world, Google, is behind Flutter, it is inevitable that it will start dominating very soon, and it is just a matter of time when Flutter will officially become the ultimate framework for cross-platform mobile development.
Links to the app I developed during my experimentation with Flutter:
iOS: https://apps.apple.com/eg/app/binaeya/id1514934132
Android: https://play.google.com/store/apps/details?id=sa.binaeya.andriod_app
Data Scientist | Machine Learning Engineer
2 年HI saud ,Please ,can you help me to know the reason of why flutter build apps for different platforms with a single code base?
EMBA, BSc CS | Project Delivery Director | Driving Digital Transformation | Focused on Customer Success
4 年Thanks Saud I enjoyed reading your Piece