Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Add Menu.isPluginAvailable to allow query of whether menus are available on the platform.#32795

Merged
gspencergoog merged 1 commit intoflutter:mainfrom
gspencergoog:menu_plugin_available
Apr 20, 2022
Merged

Add Menu.isPluginAvailable to allow query of whether menus are available on the platform.#32795
gspencergoog merged 1 commit intoflutter:mainfrom
gspencergoog:menu_plugin_available

Conversation

@gspencergoog
Copy link
Contributor

Description

Added a "Menu.isPluginAvailable" call to allow the framework to query whether a plugin for creating platform menus is available on the current platform.

This will allow the framework MenuBar.adaptive constructor to determine, based on the availability on the platform of the plugin, whether or not to render platform menus. This replaces the old way, which was just to hard code which platforms support it (i.e. just macOS), but that won't work well if someone adds a plugin that supports a particular platform that isn't macOS.

Tests

  • Added a test to make sure that Menu.isPluginAvailable returns true when called.

@gspencergoog gspencergoog changed the title Add Menu.isPluginAvailable to allow query of whether menus are availa… Add Menu.isPluginAvailable to allow query of whether menus are available on the platform. Apr 20, 2022
@gspencergoog gspencergoog requested a review from cbracken April 20, 2022 01:33
Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM stamp from a Japanese personal seal

@gspencergoog gspencergoog merged commit eeda2f7 into flutter:main Apr 20, 2022
@gspencergoog gspencergoog deleted the menu_plugin_available branch April 20, 2022 16:54
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants