Move actions to app bar on home screen

This commit is contained in:
Elias Projahn 2019-12-15 12:11:40 +01:00
parent 047ed8b7c8
commit 7bccfeaec7

View file

@ -11,29 +11,37 @@ class HomeScreen extends StatelessWidget {
return Scaffold(
appBar: AppBar(
title: Text('Musicus'),
actions: <Widget>[
PopupMenuButton(
icon: const Icon(Icons.more_vert),
itemBuilder: (context) => [
PopupMenuItem(
value: 0,
child: Text('Start player'),
),
// For debugging purposes
body: ListView(
children: <Widget>[
ListTile(
title: Text('Start player'),
onTap: backend.startPlayer,
PopupMenuItem(
value: 1,
child: Text('Add work'),
),
ListTile(
title: Text('Play/Pause'),
onTap: backend.playPause,
),
ListTile(
title: Text('Add work'),
onTap: () => Navigator.push(
],
onSelected: (selected) {
if (selected == 0) {
backend.startPlayer();
} else if (selected == 1) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => WorkEditor(),
fullscreenDialog: true,
)),
),
],
),
);
}
},
),
],
),
// For debugging purposes
body: Container(),
);
}
}