Flutter

Flutter vs. Electron for Desktop Application Development: ADB App Testing

flutter vs electron with screen

X min read

23.2.2024

article content

Flutter and Electron are two popular choices for desktop application development. Both* support cross-platform development for macOS, Windows, Linux, web, and mobile (iOS and Android) and have their respective best use cases. We’ve evaluated Flutter and Electron in the context of the XR industry by creating a desktop application for developers to connect to Android or XR devices based on Android OS. In the future, the project could expand to include a dedicated web and mobile app.

*React Native, which is very similar to Electron, allows developers to reuse large chunks of the project written in Electron.

Why We Chose Electron and Flutter for Testing: Narrowing the Requirements

While native development comes with a set of inherent benefits like better performance and hardware support, cross-platform development has an upper hand in projects that support multiple platforms. Smaller teams and lower costs with faster feature release can be a winning factor for products that are available on many platforms and operating systems.

Future project considerations are also important to consider. That’s why when choosing a technology stack for one of our XR clients, we focused on three requirements:

  • Quick feature release for major operating systems (macOS, Windows, Linux)
  • Easy porting to the web and mobile
  • Decent performance and modest resource consumption

Currently, two major players meet these requirements: Electron and Flutter.

What Is Electron?

Electron is an open-source framework developed by GitHub and OpenJS Foundation for building cross-platform desktop applications using web technologies like HTML, CSS, and JavaScript.

Based on the JavaScript/TypeScript stack, Electron is a mature technology that has existed for many years. Electron is the backbone of many popular applications, including Slack, Discord, Figma, and VSCode. It’s a desktop app development framework, with easy reuse of components from React Native and React Web. While Electron is versatile, its main drawback is memory usage. The app in Electron acts as a separate browser, which consumes much more memory than native applications.

What Is Flutter for Desktop?

Flutter is a UI toolkit created by Google for developing high-performance native applications for mobile, web, and desktop platforms.

Created in Dart, Flutter is a stable technology for mobile applications, with desktop capability still in early stages. Currently, there are only a few commercially available Flutter desktop applications, e.g., the Ubuntu Installer. Flutter for desktop naturally comes with built-in web and mobile support, with the tool’s main advantage being ease of use. Still, using Flutter for desktop application development is not yet at a mature lever, which leads to greater uncertainty for commercial projects.

Building a Flutter-Based Prototype

At Nomtek Labs we experiment, test new technologies, search for innovation, and support our sales department by mitigating risks for clients. Since we’ve been using Flutter in many web and mobile projects, we wanted to reduce the uncertainty associated with using Flutter technology in desktop application development.

We created LinkUp, a prototype that:

  • connects available devices through ADB
  • installs .apk applications on devices such as Quest 2, Quest Pro, Magic Leap 2, or Android smartphones
  • displays device logs

Flutter for desktop app development: lessons learned

Good for simple- to medium-level applications

Even though Flutter for desktop is a relatively fresh approach, the technology can be easily used to create simple- to medium-level advanced applications.

Easy UI development

What makes Flutter a particularly good candidate for desktop development is the ease with which the UI is built. Flutter for desktop lets teams quickly reuse components for cross-platform development, just like in mobile app development (Flutter is currently the most popular cross-platform development framework for mobile applications).

In contrast, reusing components in Electron between React Native and React Web isn’t that easy.

Memory Usage Comparison: Native, Flutter Desktop, and Electron

Memory usage is a crucial factor. We conducted performance tests comparing the Flutter application with its native counterpart and a HelloWorld: a basic Electron app that displays only static information. Our findings showed that the native application consumed the least amount of memory, while the Flutter application used slightly more memory than the native one but still maintained reasonable values. HelloWorld in Electron consumed a significant amount of memory.

How Fast Is Flutter Desktop?

Here's the laptop's configuration for the testing.
Electron app: memory usage.
Electron app: CPU usage.
Native app (LogRabbit): memory usage
Native app: CPU usage
Flutter app (LinkUp): memory usage
Flutter app (LinkUp): CPU usage

Flutter for Desktop: A Viable Alternative for Desktop Application Development

Although building desktop applications in Flutter is in its early stages, Flutter for desktop, on top of reasonable resource consumption, provides compatibility with the web and mobile. Paired with easy development and code reuse across platforms, Flutter edges to the forefront as a viable option for cross-platform applications. The memory usage is a factor that should be considered, but it can be maintained at reasonable levels.

Related articles

Supporting companies in becoming category leaders. We deliver full-cycle solutions for businesses of all sizes.

Need Flutter developers?

Contact us
Cookie Consent

By clicking “Accept All Cookies,” you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.