Mobile application development has always been a fundamental backbone of the tech industry, however with multiple platforms, Java for Android and Objective-C for iOS has been a problem for some time. In addition to having to have two teams, one for Android and the other for iOS, there will always be a gap between the applications developed because they are created by two totally different teams. This observation gave birth to the idea of creating cross-platform mobile applications.
Today, there are many solutions that exist that offer cross-platform development from a single code base, among the most popular currently, we have react native from Facebook and Futter from google, both platforms offer a system that allows you to create compiled applications offering performance that is closer to that of real native applications. So what are the strengths and weaknesses of Flutter and React Native?
FLUTTER
Flutter is a responsive cross-platform mobile application development framework using the dart language. Dart and Flutter were created by Google which uses the framework for some of these most important applications and constantly pushes it to be the ultimate solution for building cross-platform applications. Its very first version saw the light of day in May 2017, so it is much younger than React Native.
Responsive programming with Flutter
Flutter is a responsive framework, what does it mean? What is reactive programming and why it is powerful and useful, especially in application development. Suppose you want to send a request to a server and do something based on the response. If you act before the response is returned, you will take an action that results in an error. The situation becomes critical if your data arrives asynchronously and it is not a request sent, but a flow of user clicks for example, and many parts of your program must respond to the incoming data.
This problem gave birth to a programming paradigm called reactive programming, which is at the heart of the Dart language.
Development
The main building block of a Flutter app is a widget. Widgets are the equivalent of components to React Native. Flutter comes with a large number of ready-to-use widgets. There are two types of widgets, stateless widgets, and stateful widgets, just like class components and functional components in React. Unfortunately, Flutter’s widgets are not adaptive, so you have to do the platform-specific adaptation manually. It’s pretty easy to get started with Flutter. All you need to do is download the Flutter package, unzip it, and then create an environment variable pointing to a folder inside the unzipped folder. And you would be good to start, however, you might need to download Android Studio, configure and emulate if you don’t want to use your phone. Flutter supports the Hot Reload feature, which lets you re-run your application with any adjustments you make during development and speed up development. Flutter is officially supported on Android Studio, IntelliJ Idea, and Visual Studio Code.
Ecosystem
Flutter is certainly behind React Native when it comes to the ecosystem, as React Native had been around for two years before Flutter was released and is already well established with tons of packages. However, Flutter is catching up, and there are a lot of core mobile development packages available for public use and the Flutter ecosystem is gaining momentum with community dedication. Currently, there are over 1450 packages available for Flutter on the official dartlang.org site.
Performance
When it comes to performance, Flutter’s approach is quite different from React Native’s. The Flutter application is compiled using the Arm C./C++ library which brings it closer to machine language and improves native performance. Dart is a pretty good language on its own, and many people think that when it comes to performance, Flutter has the advantage, although it is difficult to make a definitive judgment as there are so many factors involved in the performance.
Documentation
The documentation for Flutter is incredibly good. The documentation is very useful and very comprehensive. It can be a bit difficult to read if you don’t have any programming experience, but once you get used to it you’ll find pretty much everything you need to be written in the documentation.
Architecture
Flutter is very young, making everyone unsure of the best architecture to implement for your application. However, there are a few popular architectures in the Flutter community.
You can use the BloC architecture, which corresponds to the business Logic component. The architecture was described by Google in Dart Conf2018 and states that the business logic should be taken from the presentation layer and placed in the business logic components. The block model relies heavily on flows and Rx Dart (reactive Dart), a good tool to better understand flows and Rx Marbles.
For example, there are other architectures in Flutter. For example, if you’re more comfortable with Redux / Flux, you can use these templates instead, and packages in Flutter make that possible. For small applications and structural testing, it is sufficient to store the condition inside the components.
React Native
React Native is surely the world champion in multiplatform mobile development. React Native is a JavaScript framework based on the React library, both created by Facebook, which allows you to build IOS and Android apps with a single codebase. It is mainly used by Facebook, Instagram, Airbnb and many others. React Native started as an internal Facebook hackathon project in 2013 and went public in 2015.
Development
React Native uses the component principle, but instead of using the web components that you are used to seeing on the web, such as Div and H1, you use the set of components provided by the react-native library for the mobile development. React Native also uses a virtual DOM, but not to manipulate a DOM because there isn’t one, but it is used to communicate with native UI elements. The number of widgets provided by React-Native is not as large as that of Flutter, but rather inclusive. Additionally, some of these components are adaptive. They can thus determine the platform on which they are running, whether they are on IOS or Android, and make the result suitable for that platform. It is also very easy to get started with React Native. You can start by installing the create-react native app package with npm install, then using it to create a new React Native app. One interesting benefit of developing with React Native is that the create-react native app provides expo integration. Expo allows you to run your code on your mobile device without having to plug it in, simply by scanning a QR code that appears on the console.
Ecosystem
React Native has been around for a long time. It is therefore supported by most, if not all, publishers. It also supports hot reloading. When it comes to packages, react Native is the big winner, with more than five times the number of packages available for a flutter. It’s a mature frame now and a lot more stable than flutter.
Documentation
The React Native documentation is pretty good and more user-friendly: it explains what components are, what they stand for, and how to use them. The official documentation also includes guides and common topics on cross-platform development with React Native, such as how to install and use native modules, or create platform-specific components.
Performance
React Native’s approach is different from Flutter’s. The whole application is not compiled in C / C ++ or a native language, but the UI components are compiled to their native equivalents, and the JS runs in a separate thread and communicates with them. native modules via a bridge. This allows React Native to be much faster and more efficient than hybrid solutions like Ionic / Cordova, but puts it in a difficult position compared to Flutter, which is a bit closer to native apps. Of course, having a definitive winner in the performance game is quite tricky, as there are so many factors that come into play, such as the device the app is running on, and for some people, React Native outperforms Flutter, although ‘generally,
Architecture
There are two main models in building React native apps namely Flux and Redux. Flux is the one created by the creators of the framework, Facebook, while Redux is the most popular option in the community. These frameworks are all about one-way data flow and storing your app’s state in a central location called Store, and make your app’s components as stateless as possible.
Conclusion:
Technology | Flutter |
React Native |
Programming language | Dart | Javascript |
Component library | Very large inclusive library | Smaller, not included |
Adaptive components | The components are not adaptive. Must be configured manually. |
Some are adaptive automatically |
Learning curve | Pretty quick, you have to take Dart, and responsive programming isn’t entirely intuitive | Easy to use, especially if you have used to React or Javascript before |
Created by | ||
Main architecture | Block | Flux and Redux |
EcoSystem | Not yet mature, less packages | Fairly mature, used in the production of many large enterprises around the world, many packages are available |
Hot reloading | Supported | Supported |
Github Stars | 37,200 | 68,690 |
First exit | May 2017 | Jan 2015 |
Comments are closed.