Venture into the world of single-codebase development with Flutter Bro

Flutter logo I've been programming for a while - mostly full-stack web development. As a self-employed one-man show, I have to "know everything." This means keeping up with increasing and ever-changing techs and stacks. The Flutter promise is irresistible: just one platform (Flutter) and just one language (Dart). This allows generalists like me to become specialists. Maybe I'll talk one day about by 31-topics-a-month approach to staying up-to-date. Thankfully, it's now history.

My journey to Flutter

I have to serve clients who use different platforms, and web-based isn't always possible. Some of the techs I've tried, with varying time investments:

Until my conversion to Flutter, this was my latest compromise: WinUI 3 (C#) with embedded Chromium for Windows (WebView2), SwiftUI apps with an embedded web view (WKWebView, WebKit), and Xojo with embedded HTML Viewer control (WebHTMLViewer, WebKit) on Linux. By offloading UI design to HTML / CSS / JavaScript, only the wrappers (minimal) are separate codebases. Security-restricted actions, like filesystem access, are offloaded to the native wrappers.

Enters Flutter

Unlike most of the solutions I've tried, Flutter itself draws all the controls you see on the screen. And since Flutter is open-source, you can view how any built-in control was created and customize it to your liking. Xojo (for example) supports "preprocessor directives": you can instruct the compiler to behave this or that way when compiling for this or that target platform. Flutter, on the one hand, supports platform targeting at runtime. This makes your code much easier to read and quite a bit more flexible (in the metaprogramming sense).

Dart

If you've coded in any ECMAScript variant (JavaScript / JScript / ActionScript / etc.), you'll feel right at home in Dart. It also has a C-style syntax and has many things I wish existed in JavaScript. Dart is a mature language, actively maintained and still evolving. I dismissed it initially since Google was pushing it as a compile-to-JavaScript language. Since then, though, thanks to Flutter, it's evolved into the language to write-once-deploy-everywhere. Flutter initially supported Android and iOS / iPadOS. It now also supports desktop operating systems - Windows, macOS, and Linux. It even supports compiling / transpiling to a web app.

You can play around with Dart by going to DartPad.dev: Coding in Dart on the web with DartPad

IDEs

You can write Dart code in pretty much any editor. But for Flutter development, you'll probably stick to IntelliJ or Android Studio, both of which are based on JetBrains' legacy platform (not Fleet). Flutter supports hot-reload, which is near-instantaneous after the first build, and if you keep your code healthfully modular. You can also develop in VS Code, though I haven't tried that approach. Android Studio, official screenshot

Docs and community

Surprisingly (given its potential and implications), Flutter still has a small-ish community. But its docs are second to few: they're actively maintained by Google staff. Google has a vested interest in the success of Dart and Flutter, as they dogfood it for some of their own projects. The main selling point is the single codebase that reliably (and convincingly) creates native apps on all platforms.

The Dart website and docs are available at Dart.dev: The Dart website

The Flutter website and docs are available at Flutter.dev: The Flutter website

Conclusion

In my experience, clients don't care about your tech stack as long as the product works and as long as employees don't complain. (My narrow perspective comes from a developer who typically only served companies with under 200 employees. Nearly all my clients have less than 50 employees.)