Flutter – The Future of Mobile App Development
Flutter ArchitectureThe major components of Flutter include:
- Flutter engine
- Foundation library
- Design-specific widgets
Flutter engineFlutter’s engine, written primarily in C++, provides low-level rendering support using Google’s Skia graphics library. Additionally, it interfaces with platform-specific SDKs such as those provided by Android and iOS.
Foundation libraryThe Foundation library, written in Dart, provides basic classes and functions which are used to construct applications using Flutter, such as APIs to communicate with the engine.
WidgetsUI design in Flutter involves assembling and/or creating various widgets. A widget in Flutter represents an immutable description of part of the user interface; all graphics, including text, shapes, and animations are created using widgets. More complex widgets can be created by combining many simpler ones.
Design-specific widgetsThe Flutter framework contains two sets of widgets that conform to specific design languages. Material Design widgets implement Google’s design language of the same name, and Cupertino widgets imitate Apple’s iOS design.
What differentiates it from other cross-platform frameworks? Native OEMNative OEM
- Its native languages like Java for Android and objective C for iPhone/iOS.
- The native app creates widgets to communicate between widgets or we can say view and platform services like camera, battery, etc.
- WebView frameworks like PhoneGap, ionic, or we can simply say Cordova-based framework uses WebView to render UI and uses Cordova to communicate between platform services and views.
- Reactive view frameworks like React Native or Mercury create WebView programmatically so rendering and smoothness will increase.
1. Faster code writingFor developers, Flutter means faster & more dynamic mobile app development. We can make changes in the code and see them straight away in the app! This is the so-called Hot reload, which usually only takes (milli)seconds and helps teams add features, fix bugs, and experiment faster. Hot reload is also very comfortable in developer-designer cooperation when we want to improve or experiment with an app’s look and check the effects on the spot. In other words, with Flutter, your designer or tester can work together with a developer on the UI, making changes – for example, “Put it 2 pixels right” or “Make the animation faster” – and see them immediately. Most types of code changes can be hot reloaded. But there is a list of changes that require a full restart: Hot reload Limitations.
2. One code for 2 platformsDevelopers write just one codebase for your 2 apps – covering both Android and iOS platforms. Flutter doesn’t depend on the platform, because it has its widgets and designs. This means that you have the same app on two platforms. Yet what’s important is that, if you want to differentiate your apps – it’s possible.
3. Less testingIf you have the same app for 2 platforms, it means less testing! The Quality Assurance process can be faster. Because of one codebase, the developers write automatic tests only once. What’s more, Quality Assurance specialists have less work to do, because they have only one app to check. Of course, if your apps have some differences, they need to be tested on both platforms.
4. Faster appsFlutter apps work in a smooth and fast way, without hanging and cutting while scrolling. If you want to understand why and how it works from a technical point of view, read this article.
5. Designs that your users will loveFlutter is designed to make it easy to create your widgets or customize the existing widgets. Here. you can browse a catalog of Flutter’s widgets and view, for example, Material Design widgets and Cupertino widgets.
6. The same app UI on older devicesYour new app will look the same, even on old versions of Android and iOS systems. There are no additional costs for supporting older devices. Flutter runs on Android Jelly Bean or newer, as well as iOS 8 or newer.
7. Perfect for MVPDo you need an MVP (Minimum Viable Product) for your app to show to your investors? Flutter will be perfect, especially if you have little time.
Does Flutter have any cons? 3 risks for mobile App Owners
1. It is still in betaIn April 2018, Flutter beta 2 has been announced. The Flutter team hasn’t released the stable version yet. “Our APIs are stabilizing, and we continue to improve parts of the system based on user feedback. Some key features are not yet ready for broad deployment” – we read on the official Flutter website. So this means that we can expect changes and improvements that can demand future changes in our code if we ship an app before the stable version of this is ready.
2. Libraries & support – impressive, but still not so rich as for the native developmentGoogle support for this is impressive and there are many helpful libraries with functionalities ready to be implemented. But it is still new and not every functionality which you need can be found in these libraries. This means that your developers would need to build them by themselves, which can be very time-consuming. Here you can find Flutter Packages – a list of features ready to be added to your app. What’s important is that these packages are checked, analyzed, and rated for factors like health, popularity, and maintenance. However, we can expect that the support for Flutter will improve at a rapid pace. What’s more, the Flutter team is actively involved in supporting Flutter users by frequently solving and answering requested issues.
3. Continuous Integration supportSince Flutter is still in beta, it is not widely supported by CI platforms like Travis or Jenkins. So, to achieve automatic building, testing, and deployment, your development team needs to use and maintain custom scripts like this one. However, Bitrise.io is the exception where you can find a ready-to-use build step.
Is Flutter a good idea for every kind of mobile app?There are a few cases when you should not consider if it is the proper solution:
- Progressive Web Apps & Instant Apps
- They need to be small and Flutter apps – even optimized – are bigger than native ones. The overhead varies from just a few to 20 megabytes, depending on whether it is a release or a development build.
- Apps that communicate with any hardware via Bluetooth
- This kind of feature, like BLE connections, must be developed separately for iOS and Android. You can develop them natively and add them to the main app. In this case, it’s hard to say if it will save you time.
- Apps demanding rare, little-known native libraries
- If in your app development, you expect to use any specific and rare native libraries and they are not already in Flutter’s repository, it can still be possible but it will be complicated. Developers would have to implement the custom platform channels by themselves – separately for both Android and iOS. This is what can take time