mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 10:47:25 +01:00
Move actions to app bar on home screen
This commit is contained in:
parent
047ed8b7c8
commit
7bccfeaec7
1 changed files with 28 additions and 20 deletions
|
|
@ -11,29 +11,37 @@ class HomeScreen extends StatelessWidget {
|
|||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Musicus'),
|
||||
),
|
||||
// For debugging purposes
|
||||
body: ListView(
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: Text('Start player'),
|
||||
onTap: backend.startPlayer,
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Play/Pause'),
|
||||
onTap: backend.playPause,
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Add work'),
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => WorkEditor(),
|
||||
fullscreenDialog: true,
|
||||
)),
|
||||
actions: <Widget>[
|
||||
PopupMenuButton(
|
||||
icon: const Icon(Icons.more_vert),
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
value: 0,
|
||||
child: Text('Start player'),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: 1,
|
||||
child: Text('Add work'),
|
||||
),
|
||||
],
|
||||
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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue