Member-only story

New In Flutter 4, Context Menu Platform Adaptations

Fred Grott
3 min readNov 28, 2022

--

Upcoming to Flutter 4.0, is the ability to implement adaptive context menus. And this feature just dropped into the Flutter beta channel. Let me show you how to use it.

What Is The Context Menu Controller

This is the Context Menu Controller that dropped into Flutter beta recently along with Context Menu Item:

What you do not see is that we can modify other things to get the platform adaptation, just re-using the controller in a specific way. Here, let me show you. First, let’s create a menu region for platform adaptations:

We use the defaultTargetPlatform property to detect which Platform target the Flutter Engine is rendering to.

So what does that give us?

A Platform Adaptation…

--

--

Fred Grott
Fred Grott

No responses yet