2 min Devops

Microsoft contributes foldable support features to Flutter

Microsoft contributes foldable support features to Flutter

The company has made some announcements regarding support for developing applications for foldable devices with the programming language Flutter.

Microsoft his week announced they were contributing features to Flutter for foldable devices. For example, MediaQuery now has Display Features. These are for parts of the display that can be obstructed by hardware features, such as the hinge on the Surface Duo. 

When users switch over to the master channel on their local Flutter setup, they can now access a property called ‘displayFeatures’. 

Andrei Diaconu, Senior Software Engineer, Surface Duo Developer Experience, commented in a blog post. “The news we want to share today is that the MediaQuery PR (Pull Request) is now merged,” he writes. “This means that if you switch over to the master channel on your local Flutter setup, you can now access a property called DisplayFeatures. Some devices can have multiple display features, not only one, and therefore this new property is a list.”

Merged PRs and new Samples to try

DisplayFeatureSubScreen is also merged. “When you want to display content on only one screen of Surface Duo, which is the case when showing a dialog, you now have the option of using the DisplayFeatureSubScreen widget,” Diaconu writes. “This widget is mostly needed for modal routes and is heavily used in the ‘Dialogs and popups support’. In this sense it is a steppingstone to complete dialog support. If you have custom modal routes in your app, you might want to consider wrapping them with this widget.”

There are now also new samples for developers to try. “Once you use the foldable_support_complete branch from our Flutter fork, you can try our new and shiny samples,” Diaconu writes. “These showcase all the design patterns that our team proposes for dual-screen devices. They also show you a few things you can do with dialogs or the hinge angle.”

Diaconu closes by announcing that rhe Flutter team has recently released Flutter 2.10. The most important announcement made with this release is Windows support reaching production quality, he says. “Our goal is to be where developers are and provide the best possible experience when developing for Surface Duo and these announcements only bring us all closer together.”