mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
Functional player bar
This commit is contained in:
parent
3f98037160
commit
87838ce7d2
3 changed files with 54 additions and 14 deletions
|
|
@ -1,9 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:musicus/database.dart';
|
||||
|
||||
import '../backend.dart';
|
||||
import '../music_library.dart';
|
||||
import '../screens/program.dart';
|
||||
|
||||
import 'play_pause_button.dart';
|
||||
import 'texts.dart';
|
||||
|
||||
class PlayerBar extends StatelessWidget {
|
||||
@override
|
||||
|
|
@ -28,15 +31,39 @@ class PlayerBar extends StatelessWidget {
|
|||
child: Icon(Icons.keyboard_arrow_up),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Composer',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text('Work: Movement'),
|
||||
],
|
||||
child: StreamBuilder<InternalTrack>(
|
||||
stream: backend.player.currentTrack,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.data != null) {
|
||||
final recordingId = snapshot.data.track.recordingId;
|
||||
|
||||
return FutureBuilder<Recording>(
|
||||
future:
|
||||
backend.db.recordingById(recordingId).getSingle(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
final workId = snapshot.data.work;
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
DefaultTextStyle.merge(
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.bold),
|
||||
child: ComposersText(workId),
|
||||
),
|
||||
WorkText(workId),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
PlayPauseButton(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue