mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
47 lines
1.2 KiB
Dart
47 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../backend.dart';
|
|
import '../editors/work.dart';
|
|
|
|
class HomeScreen extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final backend = Backend.of(context);
|
|
|
|
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'),
|
|
),
|
|
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(),
|
|
);
|
|
}
|
|
}
|