The San Diego Web Development Blog Latest

THOUGHTS FROM INSIDE TRAGIC MINDS

The holy grail of software development is managing a single codebase that can support multiple – if not all – of your target platforms. While responsive web development is a good start, the ultimate goal is cross-platform native development.

Over the years, there have been several attempts at reaching this objective.

In 2017, Google threw their hat in the ring with Flutter. Flutter is a free and open source initiative that consists of two parts: a software development kit (SDK) and a user interface (UI) kit for building frontend components.

Why Does Flutter Matter to Me?

Flutter allows you to write code once in a single language (Dart) that can be used to create native apps for both iOS and Android. Flutter also has two primary UI kits, one for Google (that follows Material Design) and one for Apple (that follows their Human Interface Guidelines).

The current approach to cross-platform development utilizes hybrid applications. As the name suggestions, hybrid apps have a blend of both web and native features. The main content of the app are JavaScript webviews (shared across all platforms) and a thin native wrapper, so the finished product can look and feel like other apps in the App Store and Play Store.

This approach has proven to be problematic, particularly when it comes to performance and new feature support. That said, building cross-platform native apps (e.g., React Native or NativeScript) are a great solution for many businesses today.

Flutter takes cross-platform native one step further. Their framework includes most native components built-in, rather than relying on JavaScript to communicate with these native modules. The result is better performance and less delays when new features are released.

And, because the project is backed by Google, you will have better support, more robust documentation, and faster release cycles than React Native. While there might be other options available, this solution is free, open source, and supported by a strong developer ecosystem.

Flutter Now Supports Web

As you can imagine, we're fans of any technology that allows developers to spend time focusing on core features and creating great user experiences. We've been following Flutter closely and were thrilled to hear their support for web applications is in beta.

Now, a single Dart codebase can support native JavaScript applications on web, Swift apps on iOS, and Java apps on Android. This is a big deal.

You can think of Flutter as taking the idea of a progressive web app (PWA) one step further. You can build web, native mobile, and native desktop apps, all from one codebase.

Crucially, native support for the web also comes with the features and extensions that you expect. The Flutter team shared that: "When running your Flutter app on the web, you can get full access to existing JavaScript libraries. We do all the JS-interop code behind the scenes so the plugin works as you'd expect on both mobile and web."

That means you can access powerful libraries like Firebase, Google Sign In, Sentry, and more right out of the box. In addition to pushing Flutter Web to Beta, it's important to note that Flutter Desktop for macOS is in Alpha.

This means the team is busy working on a solution that allows you to bridge together web, iOS, Android, and macOS. (With Windows and Linux support coming soon after!)

Why We're Excited About Flutter

At Tragic Media, we support different types of teams. Whether we are working with a startup that wants to ship a minimum viable product (MVP) or an enterprise customer exploring a new market, we prioritize clean code and quick iterations.

As mentioned, we think of Flutter as the next progression of the progressive web app (PWA).

Instead of having JavaScript code running on all devices, we like that Flutter compiles to native code. Thus getting you the benefits of native apps without the need for multiple, isolated dev teams and without the need to sacrifice performance.

Flutter is also a robust framework that houses all the tools that you need, allowing you to have less reliance on third-party dependencies. We prefer this method as it provides a smooth update process and fewer dependencies means fewer possible security vulnerabilities.

Furthermore, Dart uses the Skia C++ engine meaning it's packed full of features. (You can learn more about Dart here.)

In fact, it comes out-of-the-box with a command line interface (CLI) and continuous integration / continuous deployment (CI/CD) tools built-in. Last but not least, Flutter also has a great developer community.

Finally, Flutter has a roadmap for both web and native desktop, so it will ultimately become a true cross-platform native solution.

Whether you are looking to build rich apps across two platforms, or add a companion mobile app to your web experience, Flutter is worth exploring.

Conclusion

In 2020, most businesses will benefit from building applications from a single codebase. There are a small handful of companies that have legitimate reasons for supporting native desktop, web, iOS, and Android applications.

Hybrid applications (for example, a JavaScript app that is wrapped with Apache Cordova) were a good starting point. They were a solid choice for building a prototype, getting feedback, and iterating fast. But they were compromised in many ways compared to native apps, including missing out on core iOS and Android features and, above all else, were much less performant.

These hybrid apps evolved to JavaScript native apps, written in languages like React Native and NativeScript. We are now witnessing another shift. Flutter is a solid approach to rethinking “write once, run native anywhere”.

The momentum behind Flutter is worth paying serious attention to.

Remember that Flutter Web is only in beta and Flutter Desktop is just reaching alpha. That said, it's valuable to build your strategy in a way that looks to the future – a future of reusable code components, not fragmented design and development teams.

Looking to build an unmatched cross-platform experience? Contact us today for a free consultation to see if Flutter is right for your project.

Don't let your project turn into a tragedy.