HubbleCommand.github.io

Personal blog, project documentation, and ramblings

Opinion on Flutter

Posted 02 Apr 2021

I have been using Flutter for a few months, and while I feel that it is interesting, there are a few drawbacks.

Flutter is a relatively new cross-platform development framework with huge support from Google.


Layout and function in the same file

Flutter has an interesting approach compared to other mobile frameworks, where the visual aspect is defined purely programatically along with the functionality in the same file, similar to some web frameworks like React. Most other mobile frameworks like Android Studio and Xamarin have seperate XML-type files for you to define layout, and Jave / C# files to implement functionalities.

Flutter’s approach, however, has a few drawbacks.

While functionality can usually be split from the visuals, allowing you to better follow OOP principles, there are many times where the limitations of Flutter forces you to keep functionality code in the layout.

Additionally, you can end up having a rediculous amount of nested widgets to get a desired layout, making clean and legible code hard to achieve.


Web support

While Flutter 2.0 recently introduced official support for web (such support already existed in the beta channel), many things are still poorly documented and lacking features.

One of the most important thing is to be able to monetize apps and websites, of which only the former has official support. To add ads to web projects, additional time is needed to make web-specific implementations to add services like AdSense or Media.net. So far, AdSense may be possible, but Media.net will generally refuse applications for website made with flutter.

Generally speaking, making platform-specific code for mobile platforms is good, but for web is closer to a nightmare. Little documentation makes it difficult to use. Frameworks like React + ReactNative allow for incredibly easy platform-specific code writing (including for web) .


Plugins

Flutter has an active community making plugins to fill in Flutter’s gaps, but many of the WIdget ones don’t work well with other Widgets (like Snackbars).


Conclusion

In conclusion, Flutter is as good a framework as any other for simple apps that only need to present data, for example from a web source.

However it isn’t mature enough for more complex apps, where frameworks like Xamarin may be better. Additionally, while targeting web is a step in the right direction, the Flutter team jumped the gun and left some important features off the table for Flutter Web Apps.

Generally, it is still better to have different Mobile and Web codebases. The problem with implementing ads is just one reason, but generally speaking the website is going to be vastly different than the mobile app by providing more features, having a different layout, etc. While they can share code for functionalities, (web mobile vs desktop layouts, desktop layouts), UI may and sometimes should have entirely different implementations.

While many frameworks say they support a multitude of frameworks, actually getting all necessary functionality to work on all targeted platforms is another question.

React seems to be one of the only frameworks that allows you to easily make both web and native apps.