From 2dec7fdf8558714dafef7f4267a8d0f46f79350f Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Fri, 8 Jul 2022 11:34:46 +1000 Subject: [PATCH] `desktop_photo_search` Break fix (#1322) Update sample code to match https://github.com/google/flutter-desktop-embedding/pull/903 --- desktop_photo_search/fluent_ui/lib/main.dart | 16 ++++++++-------- desktop_photo_search/material/lib/main.dart | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/desktop_photo_search/fluent_ui/lib/main.dart b/desktop_photo_search/fluent_ui/lib/main.dart index e897b851f..7dcd10dbb 100644 --- a/desktop_photo_search/fluent_ui/lib/main.dart +++ b/desktop_photo_search/fluent_ui/lib/main.dart @@ -75,10 +75,10 @@ class UnsplashHomePage extends StatelessWidget { Widget build(BuildContext context) { final photoSearchModel = Provider.of(context); menubar.setApplicationMenu([ - menubar.Submenu(label: 'Search', children: [ - menubar.MenuItem( + menubar.NativeSubmenu(label: 'Search', children: [ + menubar.NativeMenuItem( label: 'Search…', - onClicked: () { + onSelected: () { showDialog( context: context, builder: (context) => @@ -87,17 +87,17 @@ class UnsplashHomePage extends StatelessWidget { }, ), if (!Platform.isMacOS) - menubar.MenuItem( + menubar.NativeMenuItem( label: 'Quit', - onClicked: () { + onSelected: () { SystemNavigator.pop(); }, ), ]), - menubar.Submenu(label: 'About', children: [ - menubar.MenuItem( + menubar.NativeSubmenu(label: 'About', children: [ + menubar.NativeMenuItem( label: 'About', - onClicked: () { + onSelected: () { showDialog( context: context, builder: (context) => const PolicyDialog(), diff --git a/desktop_photo_search/material/lib/main.dart b/desktop_photo_search/material/lib/main.dart index 89e00b5aa..0b4c3c009 100644 --- a/desktop_photo_search/material/lib/main.dart +++ b/desktop_photo_search/material/lib/main.dart @@ -78,10 +78,10 @@ class UnsplashHomePage extends StatelessWidget { Widget build(BuildContext context) { final photoSearchModel = Provider.of(context); menubar.setApplicationMenu([ - menubar.Submenu(label: 'Search', children: [ - menubar.MenuItem( + menubar.NativeSubmenu(label: 'Search', children: [ + menubar.NativeMenuItem( label: 'Search…', - onClicked: () { + onSelected: () { showDialog( context: context, builder: (context) => @@ -90,17 +90,17 @@ class UnsplashHomePage extends StatelessWidget { }, ), if (!Platform.isMacOS) - menubar.MenuItem( + menubar.NativeMenuItem( label: 'Quit', - onClicked: () { + onSelected: () { SystemNavigator.pop(); }, ), ]), - menubar.Submenu(label: 'About', children: [ - menubar.MenuItem( + menubar.NativeSubmenu(label: 'About', children: [ + menubar.NativeMenuItem( label: 'About', - onClicked: () { + onSelected: () { showDialog( context: context, builder: (context) => const PolicyDialog(),