Home >Common Problem >Will flutter replace rn?
If you want to know more, you can click: FAQ
flutter Will it replace rn? This is a question asked by many netizens, but what I want to say is that any technology has its advantages and disadvantages. There is no substitute for it. The only thing is whether it is suitable for you.
Flutter
## Flutter is Google’s mobile UI framework that can quickly build high-quality native user interfaces on iOS and Android. Flutter can work with existing code. Flutter is being used by more and more developers and organizations around the world, and Flutter is completely free and open source. Flutter is a framework built by Google’s engineering team for creating high-performance, cross-platform mobile applications. Flutter is optimized for current and future mobile devices, focusing on low-latency input and high frame rates for Android and iOS Flutter’s design is very similar to react-native, but more advanced than RN One step forward Flutter’s development language is DartEvolution of mobile cross-platform development technology
Current mainstream mobile development The platforms are Android and iOS, and there was also windows phone before. From the initial Hybrid development technology, to RN's bridging technology, to the emerging Flutter technology, cross-platform development technology has been evolving.The first consideration in cross-platform development is performance issues
The efficiency of RN is because the View is compiled into a native View, so the efficiency is higher than that based on Cordova HTML5 is much higher, but it also has efficiency issues. The rendering mechanism of RN is based on the consideration of the front-end framework. Complex UI rendering requires the overlay of multiple views. For example, when we render a complex ListView, each small control is a The native views are then combined and superimposed with each other. Think about how many objects will need to be rendered if our list needs to be slid and refreshed at this time. Therefore, the RN list solution mentioned above is unfriendly; After absorbing the lessons of the first two, Flutter chose to implement it by itself (GDI) in terms of rendering technology. Due to better controllability, it used the new language Dart to avoid RN's kind of bridge. Communication with Javascript leads to inefficiency, so it is better than RN in terms of performance; experienced developers can turn on the display boundary layout in the Android mobile developer options and find that Flutter's layout is a whole. It means that Flutter's rendering is not Use native controls for renderingreact-native framework schematic
Flutter achieves cross-platform adoption a more thorough plan. It neither uses WebView nor JavaScriptCore. Instead, it implements a UI framework by itself, and then directly draws the UI on the underlying rendering system. So the development language it uses is not JS, but Dart. It is said that the Dart language can be compiled into native code and communicate directly with native code.Flutter framework schematic
## Flutter moves UI components and renderers from the platform to the application , which makes them customizable and extensible. The only thing Flutter requires from the system is a canvas so that custom UI components can appear on the device's screen, as well as access to events (touch, timers, etc.) and services (location, camera, etc.). This is the key to Flutter being cross-platform and efficient. In addition, Flutter learned RN's UI programming method and introduced a state machine. When updating the UI, only the smallest changed area is updated.
The UI framework of the system can be replaced, but some services provided by the system cannot be replaced. Flutter uses a plug-in-like method to communicate with the system service, or a bit like a remote procedure call RPC method. This method is said to be more efficient than RN's bridging method.
Similarities and differences between Flutter and RN ●Flutter performance will be better and wirelessly close to the native experience. Dart is compiled by AOT and compiled into a fast, Predictable local code
●RN is developed in JS language and is based on React, which is more friendly to front-end engineers. Dart language has a small audience
●Flutter has implemented a set of UI frameworks by itself, discarding the native UI framework. RN can still use the native framework on its own, and both have their own advantages. Flutter has high compatibility, and RN can make use of the excellent native UI
●RN’s layout is more like css, while Flutter’s layout is more like native layout, but you need to adapt to it if you remove the xml and write directly through code
●There are still very few third-party libraries for Flutter, and RN developed early. Although it is not yet perfect, there are still more than 3,000 issues to be resolved on Flutter github, and there is still a long way to go.
There is no better, only a more suitable framework for you
The above is the detailed content of Will flutter replace rn?. For more information, please follow other related articles on the PHP Chinese website!