Flutter VS Xamarin: What To Choose For Cross-Platform Development
If you’ve decided to develop a mobile app, you’ve likely heard about cross-platform frameworks that allow developers to write code once for both iOS and Android apps. There are plenty of technologies to choose from, and Flutter and Xamarin are among the most popular of them. In the article we’ll show differences between the two technologies, so you can understand which one is more suitable for your app.
Flutter was created by Google in 2017. The framework runs on Dart language developed by Google as well. Flutter is known for how it handles heavy graphics and animations, providing nearly native performance for the apps. Among popular apps built with Flutter are several Google apps, Alibaba, My BMW and many others. Read more about Flutter in our dedicated article.
Xamarin cross-platform framework was developed by an American company of the same name founded in 2011. The technology is based on the Mono open-source project and includes tools for building apps on Android, iOS and other platforms. In 2016 Xamarin was acquired by Microsoft and made part of the .NET framework. Xamarin runs on C#. Among apps developed with Xamarin, are BBC Good Food, UPS Mobile, Alaska Airlines and others.
Flutter is an open-source software development kit and is available completely free for all developers for both non-commercial and commercial use.
Xamarin is an open-source project as well and can be used freely by individuals and small enterprises. However, since Xamarin is tightly integrated with Visual Studio, large companies need to buy Visual Studio Enterprise annual subscription, which starts at $799 and can reach $5,999 per user.
Who wins: Flutter.
Architecture and Code Reuse
Xamarin runs on C# language, and because C# is one of the .NET framework languages, it opens wide possibilities to use .NET features such as LINQ Query Syntax, asynchronous programming and others. With Xamarin.Forms API and standard interface elements the code reuse rate across platforms can reach up to 96%. Also, Xamarin provides Xamarin.Android and Xamarin.iOS tools to build platform-specific app features with code reuse rate up to 75%. Code written in Xamarin can be reused only within the .NET technological stack.
Flutter uses Dart language and most of its components come inbuilt, providing all tools required for cross-platform development. Apps on Flutter are built with widgets, which are highly customizable and match their looks to native UI. The framework uses the powerful Skia C++ engine for rendering. Flutter’s code reusability reaches 80 percent.
Both frameworks have solid architecture and receive great technological support from Microsoft (Xamarin) and Google (Flutter).
Who wins: no clear winner.
Development and Testing
Flutter comes with plenty of widgets and APIs for streamlining the development process, along with Hot Reload feature that enables the developer to see code changes instantly, without having to reload the whole app. Moreover, the framework supports testing at integration (the whole app or its part), widget (single component) or unit (single function or class) levels, and Google provides comprehensive documentation on Flutter testing.
Xamarin has a feature quite similar to Flutter’s Hot Reload — Live Reload, which allows developers to see code changes live without compilation and deployment. The framework has its Test Cloud environment and supports unit and UI testing within Visual Studio, as well as third-party testing tools, such as Appium, XCUITest or Expresso.
Xamarin and Flutter both have great testing capabilities and support testing automation, but multilevel testing puts Flutter slightly ahead.
Who wins: Flutter.
Performance and UI
Apps built with Xamarin show overall good performance, but this depends highly on the type of Xamarin framework used. While Xamarin.Android and Xamarin.iOS tools offer performance comparable to native apps thanks to the usage of native components (and more platform-specific code), the performance of Xamarin.Forms (shares most of the code between platforms) is lower, especially when it comes to handling heavy graphics. Despite Xamarin.Forms sharing some UI components across platforms, many components have to be developed separately for iOS and Android, meaning that the framework might not be the best choice for UI-heavy apps.
Who wins: Flutter.
Xamarin runs on C#, which is one of the five most popular programming languages. It belongs to .NET languages, so anyone who worked in the Microsoft ecosystem won’t have much trouble starting developing on Xamarin. An experience with Visual Studio Code will be another big plus because Xamarin is integrated with Visual Studio IDE. All in all, a widely used language shortens the learning curve for many programmers.
Who wins: Xamarin.
Popularity among developers and community support
According to a study, Flutter became the second most popular cross-platform framework in 2020, while Xamarin held fifth place. The share of developers who choose Flutter grew from 30% to 39% in the 2019–2020 period, while the number of Xamarin supporters decreased from 26% to 14%. The decrease in popularity might slow down development since there are fewer people who can help with arising issues and fewer 3rd party libraries. Anyway, since both technologies get support from such tech giants as Google and Microsoft, there are plenty of developers familiar with and currently using both frameworks.
Who wins: Flutter.
Both frameworks offer comparable tools and capabilities for the development of simple and complex cross-platform apps alike. However, Xamarin is not free for big-scale commercial use, and its community support recently saw a decrease. The framework may be the better choice for those already working in the Microsoft ecosystem, or when the rest of the technological stack is written on .NET languages. Also, if simple apps built with Xamarin show nearly native performance, apps with heavy UI might suffer from decreased FPS.
On the other hand, Flutter handles heavy animation and graphics better than other cross-platform technologies, while wide arrays of testing tools and customizable widgets make it suitable for building any apps, from MVPs to complex and UI-heavy apps. A prerequisite of learning Dart language might be a drawback for some, but with the framework’s steadily growing popularity, the developer can be sure that newly learned skills will be in demand.
We at Surf have over 10 years of app development experience and use Flutter in our latest projects. Still thinking about building an app? Fill in this short form so we can estimate your project.