`desktop_photo_search` Break fix (#1322)

Update sample code to match
https://github.com/google/flutter-desktop-embedding/pull/903
pull/1325/head
Brett Morgan 3 years ago committed by GitHub
parent 84d82b3021
commit 2dec7fdf85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -75,10 +75,10 @@ class UnsplashHomePage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final photoSearchModel = Provider.of<PhotoSearchModel>(context); final photoSearchModel = Provider.of<PhotoSearchModel>(context);
menubar.setApplicationMenu([ menubar.setApplicationMenu([
menubar.Submenu(label: 'Search', children: [ menubar.NativeSubmenu(label: 'Search', children: [
menubar.MenuItem( menubar.NativeMenuItem(
label: 'Search…', label: 'Search…',
onClicked: () { onSelected: () {
showDialog<void>( showDialog<void>(
context: context, context: context,
builder: (context) => builder: (context) =>
@ -87,17 +87,17 @@ class UnsplashHomePage extends StatelessWidget {
}, },
), ),
if (!Platform.isMacOS) if (!Platform.isMacOS)
menubar.MenuItem( menubar.NativeMenuItem(
label: 'Quit', label: 'Quit',
onClicked: () { onSelected: () {
SystemNavigator.pop(); SystemNavigator.pop();
}, },
), ),
]), ]),
menubar.Submenu(label: 'About', children: [ menubar.NativeSubmenu(label: 'About', children: [
menubar.MenuItem( menubar.NativeMenuItem(
label: 'About', label: 'About',
onClicked: () { onSelected: () {
showDialog<void>( showDialog<void>(
context: context, context: context,
builder: (context) => const PolicyDialog(), builder: (context) => const PolicyDialog(),

@ -78,10 +78,10 @@ class UnsplashHomePage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final photoSearchModel = Provider.of<PhotoSearchModel>(context); final photoSearchModel = Provider.of<PhotoSearchModel>(context);
menubar.setApplicationMenu([ menubar.setApplicationMenu([
menubar.Submenu(label: 'Search', children: [ menubar.NativeSubmenu(label: 'Search', children: [
menubar.MenuItem( menubar.NativeMenuItem(
label: 'Search…', label: 'Search…',
onClicked: () { onSelected: () {
showDialog<void>( showDialog<void>(
context: context, context: context,
builder: (context) => builder: (context) =>
@ -90,17 +90,17 @@ class UnsplashHomePage extends StatelessWidget {
}, },
), ),
if (!Platform.isMacOS) if (!Platform.isMacOS)
menubar.MenuItem( menubar.NativeMenuItem(
label: 'Quit', label: 'Quit',
onClicked: () { onSelected: () {
SystemNavigator.pop(); SystemNavigator.pop();
}, },
), ),
]), ]),
menubar.Submenu(label: 'About', children: [ menubar.NativeSubmenu(label: 'About', children: [
menubar.MenuItem( menubar.NativeMenuItem(
label: 'About', label: 'About',
onClicked: () { onSelected: () {
showDialog<void>( showDialog<void>(
context: context, context: context,
builder: (context) => const PolicyDialog(), builder: (context) => const PolicyDialog(),

Loading…
Cancel
Save