Droidcon London and Platform Views in Flutter
This week I'm attending Droidcon London where I have opportunity to talk about platform views in Flutter again. I'm super excited to see all the Flutter and Android folks out here.
Droidcon is a series of conferences focusing on Android development, and for last few years Flutter started to become more and more present. This year during Droidcon London there’s a special Flutter-oriented track filled with great talks and topics.
Today I had a chance to talk about platform views in Flutter and promised to share a blog post about it as well. So here I’m sharing with you a 101 to platform views for mobile and desktop in Flutter. I created a sample camera app that leverages platform views to display a preview on macOS, so if you’re more into a hands-on experience reader, please give it a try (contributions welcome!).
Some of my favorite talks from the 1st day (not only Flutter):
Another World in Flutter by Simon Lightfoot
Flutter on Desktop: end to end from build to distribution by Teresa Wu
Building a real-time collaboration tool using CRDTs and Kotlin Multiplatform by Anders Järleberg and Carlo Rapisarda
KMM being more and more popular
One thing I noticed this year is how common KMM (Kotlin Multiplatform Mobile) became. Many companies that have been experimenting with it few years ago have shown that now that it can be used in production-grade applications. There were at least 5 talks focused around KMM and the Droidcon app was built with it. It’s really cool to see another alternative for sharing code across platforms becoming mature.
It’s not a replacement for Flutter but definitely a thing that Flutter developers should be aware of when discussing sharing business logic between teams. Check it out if you haven’t already!
Platform Views for Mobile and Beyond
At some point in the project it may happen that you need to use platform specific SDK that does not yet have a plugin available. And what’s more difficult you may want to display some of the vendor-provided UI components instead of writing your own. Take for example camera-based heart rate scanner or advanced video editor. They may look perfectly fine in native Android or iOS app, but obviously you want to use them in Flutter. Here’s a moment when you can use platform views.
In this article we’re going to go through basics of platform views, their benefits and limitations, as well as we’ll look into displaying them on platforms that are not yet officially supported. Let’s dig in!