.NET MAUI the challenge of cross-platform solution (MAUIsland story)
Tags: csharp, dotnet, maui, windows
Published: 2023-02-28 05:47:28

Working with MAUI you have to understand the benefits and limitations well to get the most out of this technology. I have spent more than 2 months developing an open-source project to help the user get to know this technology as fast as possible and more importantly see if this is the right tool for their next UI solution. 

[MAUIsland](https://github.com/Strypper/mauisland)

This project makes me realize a lot of things that MAUI is missing and also change my vision completely if I ever want to use one code base for all platforms.

One code base all platforms in `theory` you will get the following benefits:

1. Cut down costs
2. Cut down planning
3. Cut down developments
4. Cut down maintenance 

After trying out MAUI: 

1. Cut down costs: I think what I can cut is just one of Android or IOS developer, it is so hard to cut WinUI and Mac Catalyst since the tech support isn't there yet
2. Planning: yes
3. Developments: I do cut down R&D for basic stuff but the technology adds up more development in different sections and if the client's requirements too strict developments usually cost more than you expected
4. Maintenance: No, not a lot of Xamarin or MAUI developers at the moment, and migration like every technology it's a painful process.

Pros:
1. Easy to get started for .NET developer - When you are an ASP.NET developer you will feel at home when moving to this technology, you have the `ServicesCollection`, `Dependency Injection`, and all the latest C# features, and to me this is a Christmas gift 🎁, I won't need to invest more time in research how basic things work
2. Performance - Really good, I have tested my project on low-end smartphone and the technology have no problem performing 60fps for everything, some of the lag that people encounter even on high-end smartphone I highly encourage you to read this blog [Improve CollectionView Performance](https://www.sharpnado.com/xamarin-forms-maui-collectionview-performance-the-10-golden-rule/)
3. Support - the project is very focused and actively supported by Microsoft so some of the missing puzzles are eventually supported in the future.
Cons:
1. Bugs - there are thousands of issues currently appear on their repository
2. Desktop support is still early - most of the desktop basic requirements are still missing 
3. Really hard to remain consistent on all platforms because how MAUI relies on native controls not the middle UI layer like Flutter.
4. Community is still small, not many active speakers or writers  

Conclusions: If you expect to create a mind-blown desktop and mobile with heavy UI animations and styles I think you won't archive that with this technology easily. Their x:OnIdiom is not accurate and we have to come up with our own solution for detecting what screen is the application currently running on, we also don't have an efficient way to swap UI, currently my best hope would be to the Toolkit StateContainer but have it's limited, It breaks when the state change too fast (The toolkit team already address this and fix is currently on the way delivery to the public), can't span all available space because it using the stacklayout and collectionview scrolling is frozen in it. If you only expect Android and IOS then technology can be more suitable since fewer platforms you have to maintain and consider, I should encourage everyone do not criticize the team, instead we should help them (Report issues) so eventually we might get a better product.