Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Without knowing it, youâve probably already used the apps made with Flutter. Whether you shopped on Alibaba, ran an ad campaign on Google Ads, or used a digital coupon, youâve likely witnessed the results of Flutterâs still short history.
The product has remained beta for a long time. Now, with its Release Preview 2 version, it finally stepped on the finish line before the initial 1.0 release. We understand the hesitation and excitement of the new, transformative technology for developers, so hereâs our overview of the best and the worst of Flutterâââand what you can do with it.
The first question about Flutter you might have is âHow is it different?â If youâre familiar with hybrid and cross-platform development, itâs valid to question how Flutter can be better than Xamarin, React Native, or Ionic, for that matter. Whatâs the point of switching? As we had no intention of promoting Flutter over other technologies, we decided to figure out why you should be excited about the productâââand what to be wary of.
What is Flutter exactly?
Flutter is Googleâs new open source technology for creating native Android and iOS apps with a single codebase. Unlike other popular solutions, Flutter is not a framework; itâs a complete SDKâââsoftware development kitâââwhich already contains everything you will need to build cross-platform applications. This includes a rendering engine, ready-made widgets, testing and integration APIs, and command-line tools.
Similar technologies such as Xamarin, React Native, Ionic, or NativeScript all try to achieve platform nativeness via different approaches. Weâve written a whole article comparing these cross-platform tools. Now, letâs see what Flutter introduces to the game.
Flutter follows the reactive development architecture, but with a twist. The main thing to know about reactive programming is that it updates UI contents automatically when you update the variables in the code. React Native also follows this principle, but it uses the JavaScript bridge to access OEM widgets. But since the app has to pass this bridge to access widgets each time, it causes performance issues. Flutter, however, omits this bridge altogether and communicates with the native platform using Dart.
Dart is Flutterâs object-oriented language that uses Ahead-of-Time compilation techniques and compiles into native code without that additional bridge. This noticeably speeds up the app startup time. Besides, Flutter doesnât have to call to OEM (original equipment manufacturer) widgets, because it uses its own. As seen on the image below, Flutter uses the OS as a canvas to build an interface on and moves services such as gestures, rendering, and animations into the framework itself, which gives developers complete control over the system.
Reactive frameworks vs Flutter Source: Wm Leler on Medium
Debugging in Flutter also happens thanks to Dart. Dart Analyzer and Dart Observatory tools help find errors using specific commands. The process is explained in detail in Flutter debug docs. Another method includes using Flutter-supported IDEs and their specific debuggers. Since Flutter doesnât use WebView it canât be debugged directly in a browser like Ionic. React Native and NativeScript allow for testing via Chrome Developer Tools. However, considering that these products often prefer third-party solutions for debugging anyway, Flutterâs process shouldnât appear very different.
Since Flutter is a full-fledged SDK, it already offers an automated testing toolset, specifically, for three types of tests: unit test, widget test, and integration test. You can find Googleâs tutorials for those tests at this link. Flutter also supports the Continuous Delivery model via fastlane, a free tool that bridges Flutter with Travis, Jenkins, or Cirrus.
Pros of Flutter development
Whatâs innovative, different, and simply better executed about Flutter? Letâs review the features that will make you consider abandoning React Native for a new tool.
+ Ready-made and custom widgets for fast UIÂ coding
Previously we mentioned that Flutter uses ready-made widgets. You could even say that Flutter is widgets. One of the revolutionary things about the product is how it helps create a user interface utilizing these building blocks. Compare that to other approaches that use different objects (layouts, views, controllers), when Flutter has a consistent and unified object model.
Any object in Flutter is a widget, from a button to padding or a font. Widgets can be combined to create layouts, and you can choose to use widgets on any level of customizationâââfrom existing building blocks to the lowest level when you create your own widgets with the same tools the Flutter team did theirs.
Widgets in Flutter are organized in trees, which is handy for rendering, but may result in an excessive complication of the whole structure. Large applications may require up to 10 layers of code to create a basic object, so youâll have to plan the structure ahead.
The fact that Flutter has its own widgets gives you one big advantage: Flutter already provides widgets that perfectly follow Material Design and Appleâs Cupertino looks. The UI customization that usually takes the longest to finish in cross-platform development takes a minimum amount of time with Flutter.
+ The mildest learning curve and a growing community
Given that getting used to Dart is not a massive problem to you, learning the tool itself should be easy. The Flutter team notes that theyâve seen people with very limited programming knowledge prototyping and building apps, and also mentions that no mobile development experience is required to start with Flutter.
Besides, Google is known for creating detailed and well-structured documentation, something that React Native struggles with. Apart from classic docs, you can watch video lessons from the Google team, and go through practical exercises on Codelabs. And these are just the resources provided officially. You can find courses on Udemy and Udacity, join Facebook communities, and even a study group on Slack.
For such a young technology, Flutter is growing very fast. This graph shows the interest in Flutter on StackOverflow prior to the Release Preview 2 launch in comparison with other front-end frameworks. Despite still being in beta stage, the tool is production-ready which has only piqued the crowdâs interest. Itâs available for commercial use and has already been successfully implemented in enterprises, medium-sized agencies, and startups.
Number of StackOverflow question views Source: Google Developers blog+ Dartâââsimple and effective language targeted at Java programmers
Dart is a modern object-oriented language that will remind you of Java or C++ with its syntax. It supports both strong and weak typing styles making it easy to pick up for beginners. Above, we mentioned that Dart is responsible for some of the crucial things about Flutter. Letâs analyze what about Dartâs nature makes Flutter⊠well, Flutter.
Both AOT and JIT compilation types. In development, engineers usually have to opt for the compilation their programming language provides. Programs compiled Ahead-of-Time usually run faster because theyâve been compiled before. However, in this case, the development itself slows a lot. Just-in-Time compilation results in faster development cycles, but, predictably, affects the app startup speed since the compiler does its analyzing before code execution. Flutter takes the best of both worlds by using JIT compilation during development and switching to AOT for app release.
No need for XML files. In Android development, the work is separated into layout and code. The layout should be written in XML as Views that are then referenced in the Java code. Dart takes care of that by keeping layout and code in one place. Since everything in Flutter is a widget, the layout is also created in Dart.
Better performance without a JavaScript bridge. As you already know, the app on a userâs device will run smoothly because Dart compiles into native code directly, without the bridge.
While weâre talking about Dart benefits, itâs worth mentioning that the language isnât limited to mobile developmentâââitâs also used for building web apps, and by Google no less. Itâs commonly used in combination with web frameworks, AngularDart being Googleâs own choice for some of its services.
+ Hot reload function for instantaneous updates
This tool is already engraved into Flutterâs architecture and doesnât require any plugins to work. Hot reloading basically allows you to see updates in real time. Imagine youâve encountered an error while running a program. In Flutter, you can fix it right away, continuing from where you left off, without restarting the whole thing. Going back to regular programming where deployment takes several minutes may be a struggle. Hot reload elevates programmersâ productivity, helps with quick iterations, and allows you to experiment without long delays. Xamarin and React Native have the equivalents of this feature too, but some reviews claim that itâs much faster in Flutter. Weâve yet to see benchmarks for proof of that.
Changing app UI with Hot Reload Source: BuildFlutter+ Portability
Since Flutter is not just a framework but a complete SDK, it can run on virtually any device with a screen. Third-party ports have been created to build Flutter apps for Mac OS, Windows, and Linux. They include embedding APIs, mouse and keyboard input functions, and different plugins. Some people even tried to build TV applications using Flutter. Considering the possibilities and Googleâs fondness for IoT devices, itâs fair to expect that this functionality will become official in the future.
+ Internationalization and accessibility
Being an advocate for diversity and inclusivity, Google provides built-in opportunities to make your apps accessible to a wider range of users. Usually, when you want your app to run in different languages and be used in different regions, you need to prepare your code so itâs ready for localized content which is typically created later. This process is called internationalization.
Flutter natively provides widgets based on the Dart intl package that simplifies this process. Today it supports 24 languages, but also currencies, units of measure, dates, layout options (for languages written from right to left), and more.
Flutter also ensures web accessibility and supports these three components:
- Large fontsâââadjusts font sizes to the ones a user specified in OSÂ settings
- Screen readersâââprovides spoken feedback on UIÂ elements
- Sufficient contrastâââmakes text easier to read
While all this is automated, developers should also test their designs for different settings. For instance, they can use the largest font setting to see how it fits in a small mobile screen.
Standard vs the largest possible font settings+ High performance
A lot of factors go into accessing an appâs performance: CPU usage, number of requests per second, average response time, number of frames per second, and more. The Flutter team promises a constant 60fps, which is the rate at which modern screens display a smooth, clear picture. Since any lag in such a frame rate will be immediately noticed by a human eye, developers try to maintain motion at this level.
To access how well Flutter pulls through, see this research comparing Flutter, Xamarin, and React Native performance. Spoiler alert: Flutter came in first with 58fps and a 220-millisecond launch time. Xamarin launched in 345 ms with 53fps and React Native came second with 57fps and 229Â ms.
Just a few other practical comparisons have been made. Here, Flutter almost matched native app CPU usage, but used 50 percent more memory than React Native.
Cons of Flutter development
Whenever we review a young or less popular technology, we notice the same set of drawbacks diminishing the productâs success. Even though cross-platform development is a new programming practice, Flutter sometimes loses in the battle with its slightly older competitors. What are the drawbacks?
â Lack of third-party libraries
Third-party libraries and packages play a big part in automating software development for programmers and relieving the need to code everything from scratch. These libraries are mostly open source, easily available, and pre-testedâââwho wouldnât want to try a tool thatâs been used and tested in different environments before?
For many older and more popular technologies, finding the needed package is not a big problem. As mobile developer Aawaz Gyawali says on Medium:
Talking about React Native, oh boy itâs JS. We get 10+ npm modules for everything. Just type ââŠâŠ.. npm moduleâ on Google and you will get more than 10 results. The main benefit of using RN is that the community of the developers is so big that, if you file an issue on GitHub, you will find someone who will create a module for you.
Flutter, like any new technology, doesnât share these numbers. Flutterâs official resource of free packages gets better every day with, its list of tools is still growing. At least, Flutter takes care of your UI package needs with handy widgets, but any long-term development will probably require some waiting before the product abounds in contributed content.
â Dart, again
You may have seen in our comparison of Flutter vs Xamarin, that we mentioned Dart both in positive and negative lights. Thatâs because Dart is a great language by itselfâââits paradigm should be familiar to most programmers, itâs fast and object-oriented. But it often loses in comparison to other technologies, especially giants such as JavaScript, C#, or native Objective-C and Java. Not many beginning developers will pick up Dart on their journey and finding new people for your mobile team can also be a challenge. This should be something to consider when youâre choosing a cross-platform approach.
â Large file size
Developers go to great lengths to minimize the size of an app. Users have limited storage on their phones, so itâs much more preferable to release an app that wonât make them delete it in favor of precious photos or a music library. To decrease the program size, programmers tend to avoid animations, bring the number of libraries and packages to a minimum, or compress images.
Flutter has greatly frustrated developers when the release file size of the Hello world app reached 6.7MB. Even after dropping to 4.7MB, it remained much bigger than native Java (539KB) and Kotlin (550KB) appsâââand thatâs for the bare minimum app. Although, to be fair, its competitors share the same problem, and probably even more soâââthe release version in Xamarin will take almost 16MB and 7MB in React Native.
â Issues with iOS
Since Flutter is developed by Google, developers are rightfully worried about its implementation for iOS. Thereâs no doubt that building Android apps on Flutter is fast and enjoyable since Google is directly interested in fixing bugs in the shortest amount of time. But what about Apple devices?
One of the biggest updates in Flutterâs Release Preview 2 included a pixel-perfect iOS look. The team illustrated the possibilities of Cupertino widgets by recreating iPhone settings on Flutter. However, until recently, design features werenât up to date and followed iOS 10 features while iOS 11 had already been live for months. Itâs unclear yet if updates will keep coming as fast as Androidâs version when the product will finally leave the beta phase.
How to get started with Flutter
So, weâve reviewed Flutterâs main features, dropped in some comparison with other products, and hopefully helped you form your own opinion about the technology. Now, how do you get started with Flutter?
Check your system requirements. Windows users must have Windows 7 SP1 or later (64-bit) with Windows PowerShell 5.0 and Git for Windows pre-installed. Mac OS developers need a 64-bit version with Xcode 9.0 or newer installed while Linux users donât have to comply with any special requirements.
Download Flutter SDK. Choose your OS and follow the instructions. All operating systems support development both for iOS and Android, but you will also require a platform-specific editor. Dart comes pre-installed with Flutter.
Install an editor. You can use any IDE with Flutter command lines, but Google recommends using their plugins for officially supported editors: Android Studio, IntelliJ, and Visual Studio.
Also, you may find the following links useful:
Material Design docs for Flutter
Check out the curated list of resources
Explore Flutter apps in a showcase
Review the gallery of Flutter widgets
Will Flutter replace React Native and Xamarin?
Short answer: Not yet.
Long answer: Should it? Considering the rate at which weâre improving our programming habits, itâs fair to expect a new Flutter to appear on the horizon in a few years. This doesnât mean that any older technologies become obsolete, it just gives us more options and opens new possibilities.
In business, however, the decision whether to use a new tool when thereâs an old tried and tested one can cost a lot. How to know if you should take this step? We always recommend considering these three factors:
Team. If you have in-house developers, will they gladly learn Dart and embark on creating apps differently than they did before? If you want to hire an outsource team, is there one with Flutter experience? If youâre looking to create your own development expertise, is there enough Dart/Flutter talent on the market?
Time limit. Does your team have time in between their project tasks to learn Dart/Flutter? How time-sensitive is your project?
Scope. How big a project do you have? Is it complex and long-term? Or is it an MVP that will bring minimum losses in case of failure?
Photo by Ian Parker on Unsplash
Originally published at AltexSoft Tech Blog âThe Good and the Bad of Flutter App Developmentâ
The Pros and Cons of Flutter App Development was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.