mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
mobile: Integrate with server
This commit is contained in:
parent
60a474ea56
commit
c93ebf17a0
20 changed files with 751 additions and 740 deletions
41
mobile/lib/selectors/ensemble.dart
Normal file
41
mobile/lib/selectors/ensemble.dart
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:musicus_database/musicus_database.dart';
|
||||
|
||||
import '../editors/ensemble.dart';
|
||||
import '../widgets/lists.dart';
|
||||
|
||||
/// A screen to select an ensemble.
|
||||
///
|
||||
/// If the user has selected one, it will be returned as an [Ensemble] object
|
||||
/// using the navigator.
|
||||
class EnsembleSelector extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Select ensemble'),
|
||||
),
|
||||
body: EnsemblesList(
|
||||
onSelected: (ensemble) {
|
||||
Navigator.pop(context, ensemble);
|
||||
},
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
child: const Icon(Icons.add),
|
||||
onPressed: () async {
|
||||
final Ensemble ensemble = await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => EnsembleEditor(),
|
||||
fullscreenDialog: true,
|
||||
),
|
||||
);
|
||||
|
||||
if (ensemble != null) {
|
||||
Navigator.pop(context, ensemble);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue