mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
common: Placeholder text for no performers
This commit is contained in:
parent
a0310883fb
commit
dfeaefd0b3
1 changed files with 21 additions and 18 deletions
|
|
@ -12,27 +12,30 @@ class PerformancesText extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final List<String> performanceTexts = [];
|
if (performanceInfos.isEmpty) {
|
||||||
|
return Text('Unknown performers');
|
||||||
|
} else {
|
||||||
|
final List<String> performanceTexts = [];
|
||||||
|
|
||||||
for (final p in performanceInfos) {
|
for (final p in performanceInfos) {
|
||||||
final buffer = StringBuffer();
|
final buffer = StringBuffer();
|
||||||
|
|
||||||
if (p.person != null) {
|
if (p.person != null) {
|
||||||
buffer.write('${p.person.firstName} ${p.person.lastName}');
|
buffer.write('${p.person.firstName} ${p.person.lastName}');
|
||||||
} else if (p.ensemble != null) {
|
} else if (p.ensemble != null) {
|
||||||
buffer.write(p.ensemble.name);
|
buffer.write(p.ensemble.name);
|
||||||
} else {
|
} else {
|
||||||
buffer.write('Unknown');
|
buffer.write('Unknown');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p.role != null) {
|
||||||
|
buffer.write(' (${p.role.name})');
|
||||||
|
}
|
||||||
|
|
||||||
|
performanceTexts.add(buffer.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p.role != null) {
|
return Text(performanceTexts.join(', '));
|
||||||
buffer.write(' (${p.role.name})');
|
|
||||||
}
|
|
||||||
|
|
||||||
performanceTexts.add(buffer.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Text(performanceTexts.join(', '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue