• Greg Spencer's avatar
    Implements a PlatformMenuBar widget and associated data structures (#100274) · 2d9ad260
    Greg Spencer authored
    Implements a PlatformMenuBar widget and associated data structures for defining menu bars that use native APIs for rendering.
    
    This PR includes:
    A PlatformMenuBar class, which is a widget that menu bar data can be attached to for sending to the platform.
    A PlatformMenuDelegate base, which is the type taken by a new WidgetsBinding.platformMenuDelegate.
    An implementation of the above in DefaultPlatformMenuDelegate that talks to the built-in "flutter/menu" channel to talk to the built-in platform implementation. The delegate is so that a plugin could override with its own delegate and provide other platforms with native menu support using the same widgets to define the menus.
    This is the framework part of the implementation. The engine part will be in flutter/engine#32080 (and flutter/engine#32358)
    2d9ad260
platform_menu_bar.0.dart 4.2 KB