News

Will Flutter Become a Xamarin Option?

An open source GitHub project championed by a handful of developers seeks to add Google's new Flutter mobile UI framework as an option for creating native mobile apps in the Xamarin framework.

The project, called Flutter for Xamarin, is "still under construction" after being started several months ago. The project site says it isn't expected to become a commercially viable mainstream product. Nevertheless, its goal of making the Flutter SDK available on the .NET Framework raises some interesting possibilities.

Flutter 1.0 arrived last month with a new way to code mobile apps, using the Dart programming language, its own React-inspired widgets (as opposed to native iOS and Android widgets), hot reload and fast performance boosted by hardware acceleration, among many other notable characteristics.

But even before that, some developers started the Flutter for Xamarin project, led by Adam Pedly, whose GitHub project says: "This project is never expected to be commercially viable, unless it is picked up or supported by a larger company. As it currently stands, this is just a fun side project, done by a bunch of developers in their spare time. We offer no support for solutions ever built with this framework, or any guarantee of completion."

Flutter for Xamarin Components
[Click on image for larger view.] Flutter for Xamarin Components (source: Flutter for Xamarin GitHub Project)

Despite such caveats, some community coders have voiced support for the project. In the programming section of the Reddit social site, for example, Flutter for Xamarin was posted about three months ago, with the first response being "why?". Another developer quickly answered, "It's not exactly hard to come up with possible reasons" and proceeded to do just that:

  • Because you still want to work in C# but want the ease of use and performance of Flutter?
  • Because you have existing .NET logic code shared with other projects that you want to re-use?
  • Because you still want to take advantage of the vast array of .NET assemblies and nugets at your disposal?
  • Because the maintainer wanted a hobby project to see what was possible?

Flutter for Xamarin's underlying technology includes SkiaSharp, described as "a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images."

Flutter Architecture
[Click on image for larger view.] Flutter Architecture (source: Google).

Although Pedly and his fellow coders are trying to initially support Xmarin.Android, Xamarin.iOS and UWP (Universal Windows Platform) projects, the GitHub site says there's no reason such support can't be extended to any other target that supports SkiaSharp. A transpiler will convert the Flutter SDK, which itself is written in Dart, to C# to be used in .NET applications, through use of the DartAnalyzer to examine the SDK and output it in C#.

"Flutter Bindings will include the connection between SkiaSharp and the Flutter SDK," the project site says. "We will not be using the actual Flutter engine, though we may do in the future.

"Due to previous exploratory work, the Flutter engine is difficult to integrate with since we need to expose many C++ level APIs. Due to how this is implemented in the Flutter engine currently, it would require certain modifications and would be difficult to keep in sync with the master repository.

"Hence, we will map the calls directly to SkiaSharp and Harfbuzz to draw directly on a SkiaCanvas. I could regret this, we shall see :)"

Flutter in Animated Action, Showing Hot Reload
[Click on image for larger, animated GIF.] Flutter in Animated Action, Showing Hot Reload (source: Google)

Coincidentally, the Flutter for Xamarin project isn't the only initiative connecting the two technologies, as the Flutter team has posted "Flutter for Xamarin.Forms developers" guidance, "meant for Xamarin.Forms developers looking to apply their existing knowledge to build mobile apps with Flutter."

Alois Deniel, a Xamarin developer with four years' experience, also compared that platform with Flutter in a January post titled "Flutter Introduction from a Xamarin Developer."

Developers earlier also sounded off on the "Flutter vs. Xamarin" question, with one noting "Flutter has MUCH better performance than Xamarin Forms" and another saying "Flutter will compete with Microsoft’s cross-platform mobile framework Xamarin" and another even claiming "I guess Xamarin is dead now."

Time will tell about such notions, but one thing for certain is that Flutter and Xamarin appear to be entering an interesting relationship.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube