mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
Add recording selector
As a proof of concept some widgets were seperated. The home screen now links to this instead of the recording editor.
This commit is contained in:
parent
a6d795ef3c
commit
0438296bcc
6 changed files with 308 additions and 4 deletions
42
lib/widgets/performance_row.dart
Normal file
42
lib/widgets/performance_row.dart
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../backend.dart';
|
||||
import '../database.dart';
|
||||
|
||||
import 'person_text.dart';
|
||||
import 'ensemble_text.dart';
|
||||
|
||||
class PerformanceRow extends StatelessWidget {
|
||||
final Performance performance;
|
||||
|
||||
PerformanceRow(this.performance);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final backend = Backend.of(context);
|
||||
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
if (performance.person != null)
|
||||
PersonText(performance.person)
|
||||
else if (performance.ensemble != null)
|
||||
EnsembleText(performance.ensemble),
|
||||
if (performance.role != null) ...[
|
||||
SizedBox(
|
||||
width: 4.0,
|
||||
),
|
||||
StreamBuilder<Instrument>(
|
||||
stream: backend.db.instrumentById(performance.role).watchSingle(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
return Text('(${snapshot.data.name})');
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue