Photo search: add Quit menu item (#998)

Adds a Quit menu item to exit the app.
pull/1057/head
Chris Bracken 3 years ago committed by GitHub
parent a02f74d707
commit 5f87f43226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,6 +6,7 @@ import 'dart:io';
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:logging/logging.dart';
import 'package:menubar/menubar.dart' as menubar;
import 'package:provider/provider.dart';
@ -85,6 +86,13 @@ class UnsplashHomePage extends StatelessWidget {
);
},
),
if (!Platform.isMacOS)
menubar.MenuItem(
label: 'Quit',
onClicked: () {
SystemNavigator.pop();
},
),
]),
menubar.Submenu(label: 'About', children: [
menubar.MenuItem(

@ -6,6 +6,7 @@ import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:logging/logging.dart';
import 'package:menubar/menubar.dart' as menubar;
import 'package:provider/provider.dart';
@ -88,6 +89,13 @@ class UnsplashHomePage extends StatelessWidget {
);
},
),
if (!Platform.isMacOS)
menubar.MenuItem(
label: 'Quit',
onClicked: () {
SystemNavigator.pop();
},
),
]),
menubar.Submenu(label: 'About', children: [
menubar.MenuItem(

Loading…
Cancel
Save