Flutter for Web: is it a killer of React?
During one of our recent discussions about Flutter and Flutter for Web (and I do like talking about Flutter a lot), I was asked a question, whether the final goal of our Application Development department is to fire all the front-end developers and replace them with Flutter developers. It was a joke, of course, but I think it’s a good question to think about and to discuss: what role Flutter is going to play in Web development.
Let’s think about types of Web applications we usually develop.
However good Flutter may be, using it for a static page is a huge overkill. Actually, the same I can say for React here, in the simplest case you can just go with plain old HTML and a little bit vanilla JS. Users will be thankful to you, if they don’t need to download megabytes of JS for a couple paragraphs of text.
In a more complex case though, with interactivity or animations, it can be easier to go with some framework. Just grab something like GatsbyJS and you’re good to go.
As an experiment, I’ve created a landing page in Flutter for Web. The development process was fun, but the result was unusable…
Blog means text. A lot of text. And a lot of SEO. Using “UI toolkit for building beautiful, natively compiled applications” sounds weird for me. Again, you can instead use GatsbyJS, or Jekyll, or (if you’re slightly old-fashioned) fall back to Wordpress.
Admin pages, dashboards
Verdict: maybe, but… NO
Progressive Web Apps
What do we expect from PWA? Let me think… Custom UI, a lot of interactions and animations, local storage, mobile-app-without-installation… Sounds like a job for “UI toolkit for building beautiful, natively compiled applications”. And what do you say to a single codebase for Web, Android and iOS? Abstraction over key-value database for all platforms with e.g. hive? Hot reload and PWA support out of the box? Statically typed language? Shut up and take my money!
I’m looking forward to seeing Flutter for Web in production. We have a couple of side projects, where it would be a perfect fit.
Never developed them, so it’s hard for me to say something for sure. There is Rive that can be used for animations, kinematics, effects and stuff like that. But maybe for some complex game you should prefer Unity.
So, looking at these types, I would say the best use case for Flutter for Web is PWA with custom UI, unified across platforms. Especially, if you already have mobile app written in Flutter, and need a simple and limited version of it for Web. Flutter will rise and shine here, allow you to re-use almost all of your code (but yeah, we need it to become production-ready, it’s still in beta).
That means, I wouldn’t even consider Flutter for Web as a separate product. It’s just another compilation target, so use it together with Flutter for Android and Flutter for iOS.
Returning to the question in the beginning of the article — no, flutter-for-web developers won’t replace front-end guys. Flutter for Web is a tool with rather limited functionality, but in its field it’s shining. And in no way Flutter is a killer of React. It’s a killer of React Native, though ;)
Originally published at https://developers.mews.com on January 29, 2020.