mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57: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(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('Musicus'),
|
title: Text('Musicus'),
|
||||||
),
|
actions: <Widget>[
|
||||||
// For debugging purposes
|
PopupMenuButton(
|
||||||
body: ListView(
|
icon: const Icon(Icons.more_vert),
|
||||||
children: <Widget>[
|
itemBuilder: (context) => [
|
||||||
ListTile(
|
PopupMenuItem(
|
||||||
title: Text('Start player'),
|
value: 0,
|
||||||
onTap: backend.startPlayer,
|
child: Text('Start player'),
|
||||||
),
|
),
|
||||||
ListTile(
|
PopupMenuItem(
|
||||||
title: Text('Play/Pause'),
|
value: 1,
|
||||||
onTap: backend.playPause,
|
child: Text('Add work'),
|
||||||
),
|
),
|
||||||
ListTile(
|
],
|
||||||
title: Text('Add work'),
|
onSelected: (selected) {
|
||||||
onTap: () => Navigator.push(
|
if (selected == 0) {
|
||||||
context,
|
backend.startPlayer();
|
||||||
MaterialPageRoute(
|
} else if (selected == 1) {
|
||||||
builder: (context) => WorkEditor(),
|
Navigator.push(
|
||||||
fullscreenDialog: true,
|
context,
|
||||||
)),
|
MaterialPageRoute(
|
||||||
|
builder: (context) => WorkEditor(),
|
||||||
|
fullscreenDialog: true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
// For debugging purposes
|
||||||
|
body: Container(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue